Some settings you want to make to CyberPower's UPS Powerpanel daemon
I have a CyberPower UPS and a while back I installed their
software to talk to it, in large part to get various status
information in an automated way. The
other day I discovered that it has some undesirable default
settings. So here are
some notes on things that you will almost certainly want to change
/etc/pwrstatd.conf if you're using PowerPanel too.
As I discovered, the daemon has at least two undesirable behaviors. It will power off your Linux system one minute after a power failure and then program the UPS to shut down all power ten minutes later, even if line power comes back in the mean time (if line power has come back, it at least turns back on ten seconds later). To disable shutdowns on power failure, the options I am using are:
powerfail-active = no powerfail-shutdown = no
I suspect that the latter option is sufficient by itself, but the
provided script doesn't do very much and I went for overkill. I
think these can be set with '
pwrstat -pwrfail -shutdown off' and
pwrstat -pwrfail -active off', but I edited the configuration
file directly (partly because I was already looking at it to find
things). There are similar settings for what to do when the battery
Programming the UPS to power off may only happen if you allow shutdowns on power failure (or general scripts), but I believe that you can specifically turn it off with some additional options:
# The UPS will turn power off when this time # is expired. shutdown-sustain = 0 turn-ups-off = no
The former may possibly be set with '
pwrstat -pwrfail -duration
0', but I'm not sure; the
pwrstat help text is not clear and I'm
not inclined to experiment. I don't think
turn-ups-off can be
pwrstat. According to the help text comments in
pwrstatd.conf, it looks like the equivalent of
for low battery is the
runtime-threshold setting, which also
controls how little remaining runtime there is before your system
triggers the script and starts shutting down.
My view on automated shutdowns is that if I'm in front of the computer during a power failure, I'm perfectly competent to shut it down when I determine that I need or want to do so. If I'm not in front of the computer, it can quietly run down the battery on its own in the hopes that the outage ends before the battery is exhausted.
As a side note, if you actually have an automated shutdown of your system when the UPS is running low, it's worth thinking about how the system is going to come back up when power returns. PowerPanel's 'have the UPS turn off power (then turn it back on)' has the advantage that it will restart machines that have been shut down, no matter what else happens, provided only that your BIOS is set to always power up when AC power appears (instead of being set to 'last state, whatever that was').
Comments on this page:Written on 31 October 2020.