rc.powerfail Command

Purpose

Handles RPA (RS/6000® Platform Architecture) specific EPOW (Environmental and POwer Warning) events and shuts down the system if needed, as part of EPOW event handling.

Syntax

rc.powerfail [ -h ] | [ [ -s ] [ -t [ mm ] ][-c [ ss ] ] ]

Description

The rc.powerfail command is started by the /etc/inittab file when init receives a SIGPWR signal from the kernel. The rc.powerfail command uses ioctl() to determine the state of the system. The rc.powerfail command should be called only when an EPOW event has occurred.

The various EPOW events handled by rc.powerfail and the corresponding event handling done by rc.powerfail are listed in the following table:
EPOW class Event handling done by rc.powerfail Example
1
These types of errors are considered non-critical cooling problems by the Operating System.
rc.powerfail warns the users currently logged onto the system through a cron entry which will be walled every 12 hours until the situation disappears. Redundant Fan Faults. Internal Thermal Problems.
2
These types of errors are considered non-critical power problems by the Operating System.
rc.powerfail warns the users currently logged onto the system through a cron entry which will be walled every 12 hours until the situation disappears. Redundant AC input fault.
3
These events are critical in nature and the system should be powered down as soon as possible.
rc.powerfail initiates the system shutdown in 10 minutes unless the user has specified some other wait time through the -t option. Ambient temperature approaching specification limit.
4
These kinds of errors are extreme in nature and need an immediate halting of the system.
rc.powerfail is expected to process this event in 20 seconds. In these cases, rc.powerfail warns the users currently logged onto the system and then immediately halts the system. Loss of AC input: All the power sources have lost power.
5, 7
These kinds of errors are extreme in nature and should be handled in terms of micro seconds.
Since they should be handled in micro seconds, rc.powerfail will not be handling these events. If rc.powerfail gets control in these conditions, it will continue to wait out the wait time period. All the fan systems have failed, non redundant power fault.
As previously mentioned, in case of EPOW class 3 events, the rc.powerfail command is given approximately 10 minutes prior to shut down of the system. The user can alter this time by using the -t option on the /etc/inittab file's powerfail entry. Prior to the last 60 seconds, any users still logged-on are sent a message telling them how much time remains until shutdown. If, at any time in the last 60 seconds, the event 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.

Also in case of EPOW class 3 events, rc.powerfail will allow executing environment-specific scripts (if any) to be executed before system shutdown. These scripts will be located under /usr/lib/scripts/epow, and rc.powerfail will wait for 10 seconds, by default, for their completion. This wait time can be altered using the -c option. The value provided through the -c option will be taken as the wait time for these scripts, in seconds.

Flags

Item Description
-h Gives an information message containing the power status codes and the resulting action. The rc.powerfail -h command shuts down the system if needed, as part of EPOW event handling.
-s Does not do a system shutdown if there is a power failure in systems with either a battery backup or fan fault. The logged-on users still receive all the appropriate messages, but the actual system shutdown is left up to the system administrator. This flag has no effect if a critical power failure is detected.
-t mm Gives the number of whole minutes until system shutdown in the case of a primary power loss with battery backup or fan fault. This number should be equal to half the length of time guaranteed by the battery backup. This flag has no effect if a critical power failure is detected.
-c ss Gives the number of seconds to wait for the completion of any environment specify third party scripts to be executed by rc.powerfail, at EPOW 3 situations.

Exit Status

If the system shuts down, no exit value is returned. Otherwise, the rc.powerfail command returns the following exit values:

Item Description
0 Normal condition.
1 Syntax error.
2 halt -q failed
3 shutdown -F failed.
4 An error has occurred. Shut your system down immediately using shutdown -F.
5 An undefined state. Call your Service Representative.

Security

Access Control: root only.

Examples

  1. To look at the cause of a power status equal to 3, enter:
    rc.powerfail -h
  2. To block system shutdown when non-critical power failures or fan faults occur, enter:
    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.
  3. To change the time until shutdown to 30 minutes, enter:
    chitab "powerfail::powerfail:/etc/rc.powerfail -t 30 >/dev/console 2>&1"
    Assuming the condition is not critical, the next SIGPWR received by init will have a 30 minute delay until system shutdown.

Files

Item Description
html