[CentOS] apcupsd

Wed Nov 7 00:03:34 UTC 2012
Stephen Harris <lists at spuddy.org>

On Tue, Nov 06, 2012 at 05:49:57PM -0500, m.roth at 5-cent.us wrote:
> Stephen Harris wrote:

> > # WARNING: the apccontrol file will be overwritten every time you update
> > your
> > # apcupsd, doing `make install'. Your own customized scripts will _not_ be
> > # overwritten. If you wish to make changes to this file (discouraged), you
> > # should change apccontrol.sh.in and then rerun the configure process.
> >
> > If you can't change apcupsd.conf config to meet your needs then _don't_
> > change apccontrol; add a custom script that does an "exit 99" to prevent
> > the shutdown from running.
> 
> It looks like you're right... EXCEPT that you missed the part about
> changing apccontrol.sh.in, which appears to me to be something you get if

No I didn't.  It's not relevant to rpm installs.

> you build apcusd, rather than just install it via yum. And there's no
> other obvious way to deal with not wanting to shut it down if you have
> multiple machines, and don't want to ever have it tell everybody to shut
> down.

Yes there is; create a custom script for the command ($1) that you want
to trap and make it exit 99; then apccontrol will not continue on to
the shutdown part.

Which I said previously.

> Suggestions on what I can do *other* than build the package myself? I

Read what apccontrol does; determine the commands you want to
trap (probably doshutdown, doreboot) and create a script of that name
in /etc/apcupsd/ and make it "exit 99".

FWIW, my UPS trips many times...

eg
Oct  8 10:03:11 myhost apcupsd[9774]: Power failure.
Oct  8 10:03:15 myhost apcupsd[9774]: Power is back. UPS running on mains.
Oct 10 20:57:12 myhost apcupsd[9774]: Power failure.
Oct 10 20:57:14 myhost apcupsd[9774]: Power is back. UPS running on mains.
Oct 11 18:51:35 myhost apcupsd[9774]: Power failure.
Oct 11 18:51:38 myhost apcupsd[9774]: Power is back. UPS running on mains.

You might want to check apcaccess for expected runtime

$ apcaccess | egrep 'STATUS|LOADPCT|BCHARGE|TIMELEFT|MBATTCHG|MINTIMEL'
STATUS   : ONLINE 
LOADPCT  :  24.0 Percent Load Capacity
BCHARGE  : 100.0 Percent
TIMELEFT :  36.1 Minutes
MBATTCHG : 5 Percent
MINTIMEL : 3 Minutes

-- 

rgds
Stephen