-
I have an APC UPS connected to pfSense via a USB cable. The same UPS is powering a few other devices include a raspberry pi.
What I wanted to achieve is after shutting down pfSense, I want to power off the UPS. As raspberry pi does not support WOL, a power cycle is the only way to get it up again when power line is restored.
I had spent days reading APCUPSD manual and googling but I still miss some pieces in the puzzle.
The doc said:
During the shutdown of the system after apcupsd has been forced to exit, one of the last things done by the system shutdown is to call the halt script, which is usually in /etc/rc.d/halt or /etc/rc.d/init.d/halt, or possibly in /sbin/init.d/rc.0 depending on your system. If apcupsd was properly installed, this standard halt script was modified to include a bit of new logic just before the final halt of the system. It first tests if the file /etc/apcupsd/powerfail exists, and if it does, it executes /etc/apcupsd/apccontrol killpower. It is this last step that will cause apcupsd to be re-executed with the --killpower option on the command line. This option tells apcupsd to inform the UPS to kill the power.In particular my questions are how and where
- apcupsd will write the powerfail flag file and
- apcupsd will kill the power of the UPS via apccontroll --killpower
- Is there any halt script for pfSense? How and where can I create/modify one?
- Also what was the reason the following were commented out in apccontrol:
case "$1" in killpower) printf "UPS now committed to shut down" | wall # echo "Apccontrol doing: ${APCUPSD} --killpower" # sleep 10 # ${APCUPSD} --killpower ;;
Can anyone help me sorting out how to power off the UPS?
-
@bchan If you power down the UPS with powerkill the all devices connected to UPS power line will lose their source of power, suddenly. If your pfsense appliance is connected to UPS it will also suddenly lose their power and stop without normal shutdown. This behavior it not good to your pfsense appliance, in long turn it will destroy it.
Can you make a wiring diagram of the all ups and pfsense devices? What is the role of raspberry pi in this situation?
-
@bchan said in APCUPSD: How to power off UPS:
The same UPS is powering a few other devices include a raspberry pi.
What I wanted to achieve is after shutting down pfSense, I want to power off the UPS.
I am not an apcupsd expert, but there is likely nothing you should have to do to achieve this. The apcupsd driver should instruct the ups to power down without any action required on your part. There is a delay in the ups that allows the os to finish shutting down prior to mains cut.
Are you using a remote connection to apcupsd to shut down the other devices such as the pi?
-
@bchan there is a checkbox setting “Kill on Power Fail” already, is that not working?
-