*BSD News Article 14278


Return to BSD News archive

Newsgroups: comp.os.386bsd.development
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!decwrl!netcomsv!netcom.com!jmonroy
From: jmonroy@netcom.com (Jesus Monroy Jr)
Subject: Re: Powerfail / UPS implementation
Message-ID: <jmonroyC57AsD.B00@netcom.com>
Organization: NETCOM On-line Communication Services (408 241-9760 guest)
X-Newsreader: TIN [version 1.1 PL6]
References: <2107@hcshh.hcs.de>
Date: Fri, 9 Apr 1993 05:19:24 GMT
Lines: 53

mail hm@hcshh.hcs.de
Re: Subject: Powerfail / UPS implementation
 
>> 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() ?
>>
        Pass back a message package, instead.
 
>>     - 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.
>>
        Good Idea.
 
>>     - on AC power failure the daemon sends SIGPWR to init, causing it
>>         to go to single user mode (powerfail mode ?).
>>
        It would be better to start a seperate Super User
        (or root) process.  That would allow a shutdown, even if
        only say 30 seconds are given.
 
>>     - 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.
>>
        Better yet, reboot. Let the system start fresh.
 
>> 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.
>>
        Hide the hardware set if you know how.  If not write me.
 
>> 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 ?
>>
        Good question... If you get answers can you post a FAQ on it?
 
>> Any comments ?
>>
        Those are my comments.