Anyone else around using apcupsd? I seem to be seeing a problem, and I'd like someone to check me on it: I edit /etc/apcupsd/apccontrol to replace the value of SHUTDOWN from /sbin/shutdown to /bin/false (we don't want 3 or 6 servers shutting down over a 2 second or so blip, which it really wants to do).
What's happened is that a machine shut down the other day, and looking at it, I found that the config file was set to the original code... and I *KNOW*, for a fact, that I went through every single server that's attached to a UPS many months ago, after something important shut down, and fixed all of them.
So, it looks like an upgrade undid my change, rather than creating apccontrol.rpmnew.
Has anyone seen this behavior?
mark
On Tue, Nov 06, 2012 at 04:56:20PM -0500, m.roth@5-cent.us wrote:
Anyone else around using apcupsd? I seem to be seeing a problem, and I'd
Yes
like someone to check me on it: I edit /etc/apcupsd/apccontrol to replace the value of SHUTDOWN from /sbin/shutdown to /bin/false (we don't want 3 or 6 servers shutting down over a 2 second or so blip, which it really wants to do).
It wouldn't normally do that, until the battery is almost drained.
Taken from apcupsd.conf: # If during a power failure, the remaining battery percentage # (as reported by the UPS) is below or equal to BATTERYLEVEL, # apcupsd will initiate a system shutdown. BATTERYLEVEL 5
# If during a power failure, the remaining runtime in minutes # (as calculated internally by the UPS) is below or equal to MINUTES, # apcupsd, will initiate a system shutdown. MINUTES 3
Basically, systems shouldn't shutdown with a '2 second blip' unless your battery is dead.
it, I found that the config file was set to the original code... and I
apccontrol isn't flagged as a config file in the rpm
......... /etc/apcupsd/apccontrol ......... c /etc/apcupsd/apcupsd.conf ......... c /etc/apcupsd/changeme ......... c /etc/apcupsd/commfailure ......... c /etc/apcupsd/commok ......... c /etc/apcupsd/offbattery ......... c /etc/apcupsd/onbattery ......... c /etc/logrotate.d/apcupsd
Has anyone seen this behavior?
The script says
# 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.
Stephen Harris wrote:
On Tue, Nov 06, 2012 at 04:56:20PM -0500, m.roth@5-cent.us wrote:
Anyone else around using apcupsd? I seem to be seeing a problem, and I'd
Yes
like someone to check me on it: I edit /etc/apcupsd/apccontrol to replace the value of SHUTDOWN from /sbin/shutdown to /bin/false (we don't want 3 or 6 servers shutting down over a 2 second or so blip, which it really wants to do).
It wouldn't normally do that, until the battery is almost drained.
I dunno, but it appears to, sometimes. And we have such *wonderful* power in this building, there's at least one major blip, for a second or two, every night.... <snip>
it, I found that the config file was set to the original code... and I
apccontrol isn't flagged as a config file in the rpm
......... /etc/apcupsd/apccontrol ......... c /etc/apcupsd/apcupsd.conf ......... c /etc/apcupsd/changeme ......... c /etc/apcupsd/commfailure ......... c /etc/apcupsd/commok ......... c /etc/apcupsd/offbattery ......... c /etc/apcupsd/onbattery ......... c /etc/logrotate.d/apcupsd
Has anyone seen this behavior?
The script says
# 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 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.
Suggestions on what I can do *other* than build the package myself? I dunno, the times I see it shut down have *not* shut down for 3 or 5 min, nor do I think that was the max left runtime.
mark
On Tue, Nov 06, 2012 at 05:49:57PM -0500, m.roth@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
On Tue, 6 Nov 2012, m.roth@5-cent.us wrote:
To: CentOS mailing list centos@centos.org From: m.roth@5-cent.us Subject: [CentOS] apcupsd
Anyone else around using apcupsd? I seem to be seeing a problem, and I'd like someone to check me on it: I edit /etc/apcupsd/apccontrol to replace the value of SHUTDOWN from /sbin/shutdown to /bin/false (we don't want 3 or 6 servers shutting down over a 2 second or so blip, which it really wants to do).
What's happened is that a machine shut down the other day, and looking at it, I found that the config file was set to the original code... and I *KNOW*, for a fact, that I went through every single server that's attached to a UPS many months ago, after something important shut down, and fixed all of them.
So, it looks like an upgrade undid my change, rather than creating apccontrol.rpmnew.
Hi Mark.
I've been using apcupsd for years.
I'm on Centos 5.8.
Don't you mean apcupsd.conf for your configuration settings?
That's the one I use to configure apcupsd.
Keith
----------------------------------------------------------- Websites: http://www.karsites.net http://www.php-debuggers.net http://www.raised-from-the-dead.org.uk
All email addresses are challenge-response protected with TMDA [http://tmda.net] -----------------------------------------------------------
On 6 Nov 2012, at 21:56, "m.roth@5-cent.us" m.roth@5-cent.us wrote:
Anyone else around using apcupsd? I seem to be seeing a problem, and I'd like someone to check me on it: I edit /etc/apcupsd/apccontrol to replace the value of SHUTDOWN from /sbin/shutdown to /bin/false (we don't want 3 or 6 servers shutting down over a 2 second or so blip, which it really wants to do).
Odd behaviour. I have it running on CentOS 5, OpenBSD and windows and none of these show this behaviour. I installed through yum. What settings do you have on the UPS itself? Are the servers attached to a control group with low priority?
Mike