If you have an APC UPS you may not, for whatever reason, want the OS to trigger a shutdown. The ‘apcupsd’ package will call shutdown whenever the battery capacity is reported too low. To prevent this, just edit the following file.
Edit /etc/apcupsd/apccontrol with your favourite editor. You should see something like this:
APCPID=/var/run/apcupsd.pid APCUPSD=/sbin/apcupsd SHUTDOWN=/sbin/shutdown SCRIPTSHELL=/bin/sh SCRIPTDIR=/etc/apcupsd WALL=wall
All you need to do is comment out the ‘WALL’ & ‘SHUTDOWN’ lines:
You can also prevent logins from being disabled after the shutdown trigger is sent. By default apcupsd will touch /etc/nologin to prevent logins but changing that to e.g. /tmp/nologin will mean you can still log in. Edit /etc/apcupsd/apcupsd.conf and change NOLOGINDIR to /tmp/:
Don’t forget to restart the service:
service apcupsd restart
That should be all that’s required.
Hello, will this also prevent the apcupsd to came into status “SHUTTING DOWN”?
I have a master with apcupsd that turn-offs slaves and then the master should be cut out of power when UPS runs out of power. And now I struggle with the thing, that master remains with “SHUTTING DOWN” status even when the power is back (at APC they assumed that status will reset with the host reboot).
Thanks for any help. Matus
Great stuff thanks!