Newsgroups: alt.sources.d Path: utzoo!telly!eci386!woods From: woods@eci386.uucp (Greg A. Woods) Subject: Re: UPS monitor daemon part 1 of 1 Message-ID: <1991Apr25.181844.22772@eci386.uucp> Reply-To: woods@eci386.UUCP (Greg A. Woods) Organization: Elegant Communications Inc. References: <1991Apr03.095011.9609@pilikia.pegasus.com> <1991Apr11.155416.28426@eci386.uucp> <958@fnx.UUCP> Date: Thu, 25 Apr 1991 18:18:44 GMT In article <958@fnx.UUCP> del@fnx.UUCP (Dag Erik Lindberg) writes: > In article <1991Apr11.155416.28426@eci386.uucp> woods@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