Hello managers,
I send the reply received from Dr. Tom Blinn including my original message
too as the summary.
My thanks to Tom Blinn for his comprehensive and fast response
and Matthias Dolder (Dolder_at_mail.dec.com) as well.
Thank,
Irene
_______________________________________________________________________________
Irene A. Shilikhina (e-mail: irene_at_alpha.iae.nsk.su)
Institute of Automation & Electrometry
Novosibirsk, Russia
_______________________________________________________________________________
From: Dr. Tom Blinn, 603-884-0646 <tpb_at_zk3.dec.com>
> Hello DU managers,
>
> we have DEC 2000 model 300 with DU 3.2c & APC Back-UPS 600. Since we
> can't afford to use a UPS such as SMART, it's no available powerchute
> soft that would fit to our circumstance. Therefore I was interested in
> something about powerd written by Lynux folk. I have already written my
> simplest version just to run shutdown on power failure and then to send
> a signal to the UPS to shutdown it. I have prepared a customized cable.
> Before starting my experiment, I tried to make sure that the init indeed
> processes the SIGPWR signal as I expect.
>
> In my DU 3.2c, according the manual on inittab, the action powerfail
> specifies that if init receives the SIGPWR power fail signal,
> it executes the process associated with this line.
>
> I included the following string to the inittab:
>
> pf:1234:powerfail:/bin/echo "Power problem" > /etc/mypowerfail 2>&1
>
> and as root did :
>
> #sync;sync;sync;kill -SIGPWR 1
>
> ... and nothing happened, /etc/mypowerfail not found.
>
> The same was when I tried
>
> pf::powerfail:/bin/echo "Power problem" > /dev/console 2>&1
>
> I am under the impression that the SIGPWR is trapped by the init...
> Couldn't anybody please tell me what I perceive wrong?
>
> Thanks,
> Irene.
>
> P.S. The command "init q" I tried too.
> ____________________________________________________________________________
> Irene A. Shilikhina (e-mail: irene_at_alpha.iae.nsk.su)
> Institute of Automation & Electrometry
> Novosibirsk, Russia
> ____________________________________________________________________________
What you perceive wrong is that what init actually does is what is implied
by the inittab reference page. Although the SIGPWR signal is trapped by the
init program (as are all possible signals), it does nothing in reaction to
the signal; it simply discards it, as far as I can tell.
You have both a very old version of Digital UNIX and a very old system, but
I have gone and looked at the sources for sbin/init for that version as well
as for the current version and as far as I can see, although your line seems
to match what the inittab reference page says, the actual "init" program has
no evident support for the SIGPWR signal.
At least, if it has such support, I can find no evidence of it in the source
of the program.
There is evidence in the source of the powerfail and powerwait keywords, and
of some action mask definitions for the conditions, but there is no sign of
actual code to either field the SIGPWR signal (other than to disregard it if
it is delivered), nor of any actual execution of a powerfail routine.
If you have a service contract with Digital that covers your system, you can
enter a formal problem report on this and it might get fixed in some future
release.
However, I would not hold out much hope for this being fixed in "init" in
the near future. I have examined the sources for the next major release of
Digital UNIX (in development now, due out next year some time) and there is
no evidence of any difference in behavior in that release. A more likely
outcome of a problem report would be to correct the inittab reference page
to make it clear that init doesn't actually do anything with the "power*"
lines (powerfail and powerwait).
You need to find a different way to initiate a system shutdown.
Tom
Dr. Thomas P. Blinn, UNIX Software Group, Digital Equipment Corporation
110 Spit Brook Road, MS ZKO3-2/U20 Nashua, New Hampshire 03062-2698
Technology Partnership Engineering Phone: (603) 884-0646
Internet: tpb_at_zk3.dec.com Digital's Easynet: alpha::tpb
ACM Member: tpblinn_at_acm.org PC_at_Home: tom_at_felines.mv.net
Worry kills more people than work because more people worry than work.
Keep your stick on the ice. -- Steve Smith ("Red Green")
My favorite palindrome is: Satan, oscillate my metallic sonatas.
-- Phil Agre, pagre_at_ucsd.edu
Opinions expressed herein are my own, and do not necessarily represent
those of my employer or anyone else, living or dead, real or imagined.
Received on Wed Oct 15 1997 - 06:12:04 NZDT