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.