Shuts down a system when a power failure is detected.
rc.powerfail [ -h ] | [ [ -s ] [ -t [ mm ] ] ]
Power related events are handled by the rc.powerfail script to achieve graceful shutdown of the operating system whenever possible. Note that if a critical power failure condition occurs and if battery backup is present, the operating system can take certain actions before the battery drains.
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 severe failure without any form of backup power supply, the rc.powerfail command is given approximately 20 seconds prior to halting the system. The severe failure situations include 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.
In case of a critical failure, the rc.powerfail command waits approximately 10 minutes before starting the 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 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:
Access Control: root only.
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 2 >/dev/console 2>&1"
The next critical SIGPWR received by init will have a 2 minute delay until system shutdown.
/etc/inittab | Controls the initialization process. |
The machstat command, init command, chitab command, halt command, shutdown command.