A/UX: Powering Down without Root Permission (6/93)


I want to be able to restart or power down in A/UX when I'm not the SU
(super user):

chmod 7777 /etc/powerdown
chown user /etc/powerdown

This doesn't seem to work: Do you have any ideas?

I understand some of the implications like shutting down processes, but
shouldn't one be able to simulate this as a user?

The reason why the procedure mentioned above doesn't work is because the
/etc/powerdown program performs a getuid() system call to check which user
is running the program. This call returns the real user ID of the user and
not the effective user ID obtained with the set uid bit.

The only way to execute the power-down without actually logging on is to
make an entry in the file /etc/passwd in which the starting program is
/etc/powerdown, and the user ID is "0" (zero). This entry could look like:

stop::0:1000:Entry to powerdown the system:/:/etc/powerdown

We do not recommend powering down the system this way, because there are
several processes running in the background when the system is in an init
level other than "s" (single-user mode).

The proper way to power is to execute the shutdown command, and, when the
machine reaches "Single User Mode", execute the /etc/powerdown command.

Article Change History:
24 Jun 1993 - Revised for clarity.
31 Aug 1992 - Reviewed for technical accuracy.


Published Date: Feb 18, 2012