Hey all,
So I have been doing a bunch of reading on this and come up a little short.
Many guides suggest editing the /etc/apcupsd/apcontrol script to insert custom commands at shutdown time, but the comments in the file itself warns against doing this, as this file is replaced during updates.
There are many references to a "proper" way of doing this, but I have googled a lot and not come up with what this proper way is.
In my setup, I would like to use plink to send an ssh command to shutdown another host when battery power gets low.
I tried this by entering commands into apccontrol (like is recommended against) and my commands that work fine in shutting down the remote system when entered directly in console, are not having any effect once called from apccontrol. I am currently assuming this is because the server with apcupsd installed is running on an ssd, and thus shuts down VERY fast, possibly before the completion of my command.
Does anyone have any suggestions?
I was thinking of maybe creating a cronjob that runs on shutdown, but I have found cron - while great in time based commands - to be very unreliable when it comes to running things at startup and shutdown.
I'd appreciate any suggestions!
--Matt
Bookmarks