Shuts down a system when a power failure is detected.
rc.powerfail [ -h ] | [ [ -s ] [ -t [ mm ] ] ]
The rc.powerfail command is started by the /etc/inittab file when init receives a SIGPWR signal from the kernel. The rc.powerfail command first calls the machstat command to determine the state of the system. The rc.powerfail command should be called only when a power failure or fan fault has occurred.
In the case of a critical power failure without any form of backup power supply, the rc.powerfail command is given approximately 20 seconds prior to shut down of the system. These critical situations are loss of primary power, thermal high, internal failure, or power supply overload. In these cases, rc.powerfail warns the users currently logged on to the system and then immediately halts the system.
If there is a fan fault or if a battery backup power supply is attached to the system, the rc.powerfail command is given approximately 15 minutes prior to shut down of the system. The user can alter this time by using the -t option on the /etc/inittab file powerfail entry. Prior to the last 60 seconds, logged-on users are sent messages telling them how much time remains until shutdown. If at any time in the last 60 seconds the fan fault clears, the system shutdown halts and the users are notified that all errors have cleared. If a shutdown is NOT desired, the user may add the -s option to the command in the /etc/inittab file.
If the system shuts down, no exit
value is returned. Otherwise, the rc.powerfail
command returns the following exit values:
rc.powerfail -h
chitab "powerfail::powerfail:/etc/rc.powerfail -s >dev/console 2>&1"
The next SIGPWR received by init will NOT cause a system shutdown if a non-critical power failure occurs.
chitab "powerfail::powerfail:/etc/rc.powerfail -t 30 >/dev/console 2>&1"
The next SIGPWR received by init will have a 30 minute delay until system shutdown if the condition is not critical.
/etc/inittab | Controls the initialization process. |
The machstat command, init command, chitab command, halt command, shutdown command.