I have mini PC with 2 NICs running OPNsense for the last 2 years, and it's been great. I have the PC plugging into an APC SmartUPS and the apcupsd plugin installed.
All my other systems are Linux, and the way I have them configured they shut down when there is 5 minutes of battery life left. Also, they are all configured to start back up when power is restored (I've configured the UPS to wait until the it's 80% charged before restoring power).
So today we had a short power outage, and after 30 minutes the power was restored. All the Linux boxes came back up gracefully, but the OPNsense box was stuck with the following on the console:
"The operating system is halted, press any key to reboot."
So even when power was restored, it would just sit there waiting. Not ideal if you're away from the office. Investigation revealed that this file:
/usr/local/etc/apcupsd/apccontrol
controls what happens on APC UPS events. As you can see in this case statement:
doshutdown)
printf "Beginning Shutdown Sequence" | wall
${SHUTDOWN} -p now "apcupsd initiated shutdown"
When told to shutdown the command being run is
shutdown -h now
This works great on Linux, however on FreeBSD it halts the machine and doesn't power it off. If you want the machine to power off (as I do), modify the command instead for FreeBSD:
shutdown -p now
I hope that this helps others.
Sorry, I showed the command after I had edited it. Prior to editing it had "-h".