1833187 Members
2901 Online
110051 Solutions
New Discussion

/sbin/powerfail

 
SOLVED
Go to solution
ViS_2
Frequent Advisor

/sbin/powerfail

Hi!
I have a test machine D370
# uname -srm
HP-UX B.11.11 9000/861

In the /etc/inittab there is a string:

# grep powerwait /etc/inittab
powf::powerwait:/sbin/powerfail >/dev/console 2>&1 # powerfail

At the begining of the /sbin/powerfail I include the string like this:

/bin/echo "In the /sbin/powerfail" >/powerfail.log

Then:
# init q

And switch off the power buttom at the front side of the server

As I think after rebooting the file /powerfail.log should be preset. However it is does not.

The same situation appears on machine rx2620/HP-UX 11.23

The question is: WHY???
3 REPLIES 3
Muthukumar_5
Honored Contributor

Re: /sbin/powerfail

powerwait action is saying as,

Execute the process associated with
this entry only when boot init
receives a power-fail signal (SIGPWR)
and wait until it terminates before
continuing any processing of inittab.

After configuration with /etc/inittab, kill init process with PWR (signal 19) as,

# kill -19 1

It will create that file.

hth.
Easy to suggest when don't know about the problem!
Orhan Biyiklioglu
Respected Contributor
Solution

Re: /sbin/powerfail

http://docs.hp.com/en/935/boot.html

states

"The HP-UX kernel must be correctly configured to support the powerfail operation. You can change the value of the powerfail variable (the default is zero) by using the reconfiguring the kernel section of sam(1M)."


Also check the /etc/powerfail.cfg file.

You should put your commands into /etc/local/powerfail file instead.

hth


ViS_2
Frequent Advisor

Re: /sbin/powerfail

#grep -i power /usr/sam/lib/kc/*.tx
/usr/sam/lib/kc/drivers.tx:pfail::Unallowed:0:Power Fail CDIO
/usr/sam/lib/kc/params.tx:hdlpreg_hash_locks:::Pregion::Number (Given As Power of Two) of Spinlocks Allocated to Pregion Hash Table Objects:KCparam.Undocumented.sdl
/usr/sam/lib/kc/params.tx:pfail_enabled:::Miscellaneous::Power Fail Enabled:KCparam.PfailEnabled.sdl
#

# echo "pfail 1" >>/stand/system
# echo "pfail_enabled 1" >>/stand/system
# config
WARNING: No such device, tunable, or cdio pfail.
Ignoring the following line.
pfail 1
WARNING: No such device, tunable, or cdio pfail_enabled.
Ignoring the following line.
pfail_enabled
<..skiped..>
#

So is there any method to shutdown unix properly by pressing the power button on the server's front side, like it happens to proliant servers and windows?