Prevent OPNsense from shutting down due to UPS shutdown signals (NUT-Tools)

Started by paul_, April 21, 2025, 03:27:51 PM

Previous topic - Next topic
Background:
I am using a UPS that sends a shutdown signal (via the killpower file) to multiple devices, including OPNsense (the firewall). However, I only want my two servers to shut down, not the firewall.

I need a persistent solution that survives reboots and updates, so OPNsense doesn't automatically shut down when the UPS triggers the shutdown event.

Steps Attempted:
Modified /usr/local/etc/nut/upsmon.conf to change the shutdown command (SHUTDOWNCMD) to a custom script that blocks shutdowns based on the presence of the killpower file. Unfortunately, this file gets overwritten on every reboot or NUT service restart.

Created custom scripts to block shutdowns when the killpower file is present, but OPNsense still shuts down immediately when the UPS triggers the shutdown event.

Used the OPNsense Web UI tunables feature to set environment variables for custom shutdown logic, but the changes don't persist or prevent the shutdown.

Modified /usr/local/etc/rc.shutdown to include logic for blocking shutdowns, but the shutdown still happens immediately when the UPS signal is triggered.

Desired Outcome:
OPNsense should NOT shut down when the UPS sends a killpower shutdown signal.

The solution should be persistent and should work across reboots and updates.

The solution should only block shutdowns for OPNsense while allowing the two servers to shut down as normal.


Thanks in advance for your help guys!