1848986 Members
6835 Online
104040 Solutions
New Discussion

/sbin/powerfail

 
SOLVED
Go to solution
James A. Donovan
Honored Contributor

/sbin/powerfail

What is this supposed to do???

Found a commented entry in /etc/inittab and am wondering what this is used for? I can find zero documentation on it.
Remember, wherever you go, there you are...
4 REPLIES 4
Wodisch
Honored Contributor
Solution

Re: /sbin/powerfail

Hello,

this is to be executed AFTER the power has been re-established after a power-failure and was only useful back in those days when we had a battery backed-up RAM (which kept the contents up to 4 hours only, IIRC). If within that time frame power was re-established, that script was used to save everything to disk and (usually) reboot...
HTH,
Wodisch
BTW: it is a script - you can read it ;-)
John Payne_2
Honored Contributor

Re: /sbin/powerfail

But it can still be used if you want to run scripts after a powerfail. It also will send a report to a logfile that the powerfail happened, and can pipe a message to all users that the powerfail took place.

Useful if you what to run a script following a powerfail, I guess...

Also see /etc/powerfail.cfg

John
Spoon!!!!
Roger Baptiste
Honored Contributor

Re: /sbin/powerfail

hi,

THe documentation is
cat /sbin/powerfail ;)
**
#!/sbin/sh
# @(#) $Revision: 72.2 $
#
# NOTE: This script is not configurable! Any changes made to this
# script will be overwritten when you upgrade to the next
# release of HP-UX.
#
# This script is run when the powerfail entry is executed from /etc/inittab.
# Powerfail handling is controlled by three scripts:
# /sbin/powerfail HP-supplied execution script, not to be modified
# /etc/powerfail.cfg user-modifiable configuration values
# /etc/local/powerfail user-modifiable execution script
....
***

I think this goes along with UPS battery backup of the system , such that when the power fails and system switches over to ups, the init's powerfail entry runs this script which runs userdefined scripts (shutdown oracle, applications ?) and sends wall to the users before shutting down. All geared to clean shutdown.

HTH
raj
Take it easy.
Carlos Fernandez Riera
Honored Contributor

Re: /sbin/powerfail

Yes, it manages UPSs signals.

UPS are conneted via asyncrous port to computer box. When power fail, UPS turn on and raise a signal for this condition.

Powerfail can manage this signal and wait up to x minutes to shutdown box if power dont return.

This is the reason it has a respawn condition on inittab, if not commented.
unsupported