powstatd for Debian
-------------------

Powstatd for Debian came in two favours prior to version 1.5.1-3: the
regular powstatd package and the powstatd-crypt package which encrypted
communication between master and slave (when many computers are connected
to the power supply of a UPS, but only one of them is connected to the
serial line and knows when a shutdown should be done because of a power
failure).  Since 1.5.1-3, the encryption is used in the powstatd package
and the powstatd-crypt package was removed.

If you are upgrading from an older version of powstatd (< 1.5.1-3) and use
master/slave communication, then an identical password must appear in both
master and slave /etc/powstatd.conf files.

----------

Quickstart:

After installing the powstatd package, you must configure it by editing the
file /etc/powstatd.conf to suit your UPS and serial line, and then remove
the line:

#!Unconfigured! Please customize the file as appropriate and remove this line

The daemon /etc/init.d/powstatd won't start until that "Unconfigured"
comment is removed.

See the powstatd (8) man page for help on configuring /etc/powstatd.conf.
The directory /usr/share/doc/powstatd/ contains a few powstatd.conf sample
files.  If you get this software working with a different UPS models,
please let me know and I will include your conf file as another example and
I will forward it upstream.

After your conf file is correctly setup, you may then start the powstatd
daemon by executing, as root:

# /etc/init.d/powstatd start

You may also want to edit /etc/init.d/powerfail at the line:

 failtime=+5     # shutdown delay from initial power failure

It sets the shutdown delay to 5 minutes after power line failure detection.
You may want to increase that if your UPS has lots of power to spare, or
reduce it.

----------

The package differs from the upstream installation in a few ways:

 _ Added the #!Unconfigured! comment in /etc/powstatd.conf to avoid
   starting an unconfigured daemon. 

 - Upstream wants /etc/inittab to have the following lines:

    # UPS signals a power outage.
    pf:12345:powerfail:/sbin/powstatd.fail
    # UPS signals power restored before the shutdown kicks in.
    pr:12345:powerokwait:/sbin/powstatd.ok
    # UPS signals low battery power: emergency shutdown.
    pn:12345:powerfailnow:/sbin/powstatd.low

   On Debian, the calls are to a single script with differing arguments:

    # What to do when the power fails/returns.
    pf::powerwait:/etc/init.d/powerfail start
    pn::powerfailnow:/etc/init.d/powerfail now
    po::powerokwait:/etc/init.d/powerfail stop

   I have therefore created a /etc/init.d/powerfail script which combines
   the actions of the 3 upstream scripts.

 - The scripts /etc/init.d/powstatd and /etc/init.d/powerfail are written
   for Debian; We don't use the upstream /sbin/powstatd.{fail|low|ok}
   scripts for compatibility with Debian's inittab. The upstream
   /etc/init.d/powstatd script (to start and stop the powstatd daemon)
   shuts down the UPS when called with the "stop" argument (by sending a
   `powstatd -k` signal).  On Debian, we simply shut down the daemon on
   "stop"; Killing the UPS is done in /etc/init.d/halt by calling the same
   script (symlinked to "ups-monitor") with the "poweroff" option.


Peter S Galbraith <psg@debian.org>, Mon, 23 Aug 1999 12:58:55 -0400

 -- Peter S Galbraith <psg@debian.org>, Sun Apr  4 21:19:19 2004
