*BSD News Article 14040


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!elroy.jpl.nasa.gov!swrinde!sdd.hp.com!nigel.msen.com!yale.edu!ira.uka.de!Germany.EU.net!hcshh!hm
From: hm@hcshh.hcs.de (Hellmuth Michaelis)
Newsgroups: comp.os.386bsd.development
Subject: Powerfail / UPS implementation
Keywords: ups powerfail device driver init
Message-ID: <2107@hcshh.hcs.de>
Date: 5 Apr 93 18:25:48 GMT
Organization: HCS GmbH, Hamburg, Europe
Lines: 41

One of the machines nearby has a uninterruptable power supply built in and
i would like to have it activated.

So what is the best (most generic) way of implementing it into 386BSD ?

What i have in mind is:

	- a device driver capable of reporting the status of the power
		supply (running from AC / running from DC). Should the
		query be implemented as a read() returning a char or
		as a ioctl() ?

	- a daemon starting at /etc/rc.local and running in the background
		asking every minute or so for the power supply status by
		using the device driver above.

	- on AC power failure the daemon sends SIGPWR to init, causing it
		to go to single user mode (powerfail mode ?).

	- now init has to monitor the power supply, if the AC power comes
		back again. if AC comes back again, init takes the system
		back to multiuser mode, else the batteries get empty, then
		after AC power comes back, init reboots as usual.

The only hardware dependent part would be the device driver, but since the
output is binary (power good/bad) the driver should be simple to adapt to
common ups-monitoring devices.

Since the only (PC-based) ups-device i have ever seen is mine (built in),
is the above draft sufficient as a general purpose solution ?

Does another solution already exist for 386BSD ?

Any comments ?

hellmuth

-- 
hellmuth michaelis    HCS Hanseatischer Computerservice GmbH    hamburg, europe
hm@hcshh.hcs.de              tel: +49/40/55903-170          fax: +49/40/5591486
[ the opinions expressed above are my own and not the opinion of anybody else ]