UPS monitor daemon part 1 of 1
Greg A. Woods
woods at eci386.uucp
Fri Apr 26 04:18:44 AEST 1991
In article <958 at fnx.UUCP> del at fnx.UUCP (Dag Erik Lindberg) writes:
> In article <1991Apr11.155416.28426 at eci386.uucp> woods at eci386.UUCP (that's me!) wrote:
> >A more elegant solution for System V is to just sent a SIGPWR to init,
> >i.e. kill(1, SIGPWR); and have your inittab configured correctly to
> >"do the right thing" with powerfail (and/or powerwait) entries. Why
> >waste all that code which was put there for just this feature?
>
> WRONG!!! This may be good enough for a single user workstation, but
> any multi-user system *MUST* warn users of impending doom to allow
> them to save their work, shut down whatever they are doing, and exit
> in a way that will allow them to resume work as quickly as possible
> when power is restored. Don't assume that everyone will be aware
> power went out on the system, they could be in a different building,
> or even another city.
Uh, I said "do the right thing".... On my 3b2, which is certainly not
a workstation(!), when init receives a SIGPWR, such as when the
"power" switch is flicked to off, the system is gracefully shut down,
giving the users a one-minute warning to log off.... I never assume
anything! :-)
> >/etc/shutdown scripts are for human users, and can vary widely -- some
> >even ask for confirmation! Not something the average daemon can answer!
>
> So don't use the supplied shutdown script. Modify it, or write another.
No, I'd change the deamon to do a 'kill(1, SIGPWR)', then make sure my
inittab and related scripts did the right thing (i.e. the same way my
3b2 works).
On the other hand, with my 3b2, a directly connecting the UPS to the
powerfail line on the "power" switch into the motherboard eliminates
the need for the daemon in the first place!
--
Greg A. Woods
woods@{eci386,gate,robohack,ontmoh,tmsoft}.UUCP ECI and UniForum Canada
+1-416-443-1734 [h] +1-416-595-5425 [w] VE3TCP Toronto, Ontario CANADA
Political speech and writing are largely the defense of the indefensible-ORWELL
More information about the Alt.sources.d
mailing list