From owner-freebsd-hackers Thu Oct 5 14:37:58 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id OAA23041 for hackers-outgoing; Thu, 5 Oct 1995 14:37:58 -0700 Received: from casparc.ppp.net (casparc.ppp.net [194.64.12.35]) by freefall.freebsd.org (8.6.12/8.6.6) with SMTP id OAA23028 for ; Thu, 5 Oct 1995 14:37:34 -0700 Received: from ernie by casparc.ppp.net with uucp (Smail3.1.28.1 #1) id m0t0xta-000I0yC; Thu, 5 Oct 95 22:32 MET Received: by ernie.altona.hamburg.com (Smail3.1.29.1 #3) id m0t0xd6-00001AC; Thu, 5 Oct 95 22:15 MET Message-Id: From: hm@altona.hamburg.com (Hellmuth Michaelis) Subject: Re: Fiskars UPS support... To: owensc@enc.edu (Charles Owens) Date: Thu, 5 Oct 1995 22:15:00 +0100 (MET) Cc: hackers@freefall.freebsd.org, msmith@atrad.adelaide.edu.au In-Reply-To: from "Charles Owens" at Oct 5, 95 09:18:28 am Reply-To: hm@altona.hamburg.com X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 1602 Sender: owner-hackers@FreeBSD.org Precedence: bulk > Mark Smith said: > > > The crucial issue in this case is, once the UPS has sounded its death knell, > > ie. power's out, and battery holdout is down to a few minutes, what should > > one do? > > > > If you decide to shutdown, and then power comes back, you're stuck > > shutdown, waiting for the power failure to reboot you. > > If you go single-user, can you arrange to have the daemon survive the > > shutdown and send an appropriate signal to the root shell when the power > > comes back? > > > > Or would it be better to reboot and then as part of the boot process wait > > for the UPS to give the all-clear? Some time ago i did such a thing for FreeBSD, the current version can be found on ftp.freefall.org in pub/FreeBSD/incoming/freebsd205ups.tar.gz. The thing consists of a device driver with which the status of the AC line is accessible, a daemon constantly monitors it and in case of a power fail it shuts the system down after a specified amount of time, leaving a file "/powerfail" and reboots. When the system comes up again, one of the very first things which is done in /etc/rc is to check whether there exists a file "/powerfail", if so, it enters a tight loop waiting for either AC power coming back or the battery becoming empty. I had to do it this way because the UPS is built-in into the machine and there are only 2 flags available: AC fail and battery OK at power up, nothing else. It works. hellmuth -- Hellmuth Michaelis hm@altona.hamburg.com Hamburg, Europe (A)bort, (R)etry, (I)nstall BSD ?