bpowerd v2.1
NOTE: This product is in no way affiliated with Best Power
and is neither endorsed nor supported by them.
What is bpowerd
bpowerd is a program to monitor Best
Power Patriot and Patriot Plus UPSs under Linux. It uses init to inform the system of
a power outage and is capable of detecting power fail and low battery
conditions. It is also capable of killing the inverter on shutdown.
Why should I use bpowerd
bpowerd is a daemon, not a normal Unix process and makes proper use of syslog
for error logging. It uses init's powerstatus calls to do it's dirty
work instead of calling shutdown itself, as the Best supplied one does. The
last I checked it also supported more of the functionality of the UPS than
Best's software, but I haven't looked at their code in a while.
How does it work
There are two ways this can happen, which one you use depends on which init
was detected by the configure program:
The BSD way
The following is the steps taken in the event of a powerfail
- bpowerd detects failure and writes FAIL to /etc/powerstatus and either
FAIL or SCRAM to /etc/upsstatus for a power failure or low battery condition
respectively.
- bpowerd signals init with SIGPWR
- init executes the command in the line starting with "pf", this should be
a call to bpowerfail with the "start" argument
- bpowerfail executes the command associated with the state in /etc/upsstatus
If the power comes back on "OK" is written to both /etc/upsstatus and
/etc/powerstatus and init is signaled. init then runs the command on the line
starting with "pg" which should be a call to bpowerfail with the "stop"
option. bpowerfail then halts all running shutdowns.
The SysV way
- bpowerd detects a state change and sends a struct with the power status
to /dev/initctl
- init executes the appropriate line from the /etc/inittab
- bpowerfail executes the command associated with the argument passed it
by init
Where is bpowerd
On January 6, 2001 bpowerd moved to SourceForge. See the
project page for files.
What is the lastest version
2.1 was released November 11, 1998. This only has documentation and support
script changes (mainly those submitted by Mitch Blevins), and since I know for
a fact that only one person downloaded 2.0 (Mitch Blevins). I don't think this
really affects anybody.
2.0 was released November 10, 1998. This has some pretty major changes from
1.1. Namely on systems with SysVinit (most Linuxes) it now uses /dev/initctl
instead of yucky state files in /etc or /var/run. It also now has a configure
script that should detect where the stuff it needs is.
Who maintains bpowerd
Christopher Craig maintains the RedHat packages and main source tree. The
Debian package is maintained by Mitch Blevins and if you wish
the source of those
is also available.