[comp.unix.xenix] Problems shutting down XENIX from background.

waldis@eecae.msu.edu (Andrew T Waldis) (08/28/90)

I am trying to write a background process to periodically monitor a
set of conditions and shutdown the system if certain conditions become
true.

The background process is started at system initialization from the
directory /etc/rc.d/7.  When it needs to shutdown the system it does a
system( "shutdown" ).  The problem is that the shutdown script includes a
call to "who am i" and expects root|sysadm|"" in $1 and tty* in $2 to
shut down the system properly.  When I run "who am i" from the backgorund,
I get "0" for the username and "" for the terminal.

Does anyone know a way to get "who am i" to return root|sysadmin|"" for
the username and tty* for the terminal when run from a background process?
I do not want to have to modify the shutdown script to do this.

-------------------------------------------------------------------------
Andrew Waldis  -  waldis@frith.egr.msu.edu