TrueNAS shuts down UPS when NUT initiates powerdown

gordon19284

Dabbler
Joined
Dec 13, 2021
Messages
14
I have my TrueNAS SCALE system connected to an APC Back-UPS Pro 1500VA. I have my UPS connected to TrueNAS via USB, and I have NUT (The UPS service) configured to shut down the server 90 seconds after the UPS goes on battery power. There is a "Power Off UPS" setting. I do not have it checked. Nevertheless, whenever my UPS goes on battery power, after 90 seconds the server shuts down as expected, but also sends the shutoff signal to the UPS, powering it down completely and cutting power to all the less power-hungry devices like my router that I want to stay up.

This is the exact behavior described in this post from 2015: NUT Powers off UPS. In upsmon.conf, I see the following:

Code:
SHUTDOWNCMD "/sbin/shutdown -P now"
POWERDOWNFLAG /etc/nokillpower


UPS.conf:
Code:
[ups]
    driver = usbhid-ups
    port = auto
    desc = ""



TrueNAS-SCALE-22.02.1

Any idea how I can get TrueNAS to stop shutting down my UPS?
 

gordon19284

Dabbler
Joined
Dec 13, 2021
Messages
14
Deleting the line entire POWERDOWNFLAG /etc/nokillpower and restarting NUT fixes this.

If the "Power Off UPS" setting is On, this line changes to /etc/killpower, and for off it's /etc/nokillpower. However, it doesn't seem to matter. Simply the presence of POWERDOWNFLAG causes the UPS to be sent the shutdown command.

Unfortunately, any manual edits to upsmon.conf are reverted whenever the system reboots.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
There's no need to manually edit upsmon.conf. There's a convenient check box in the UPS service for this:

1652321573277.png


Just navigate to Services->UPS, and click the pencil icon to edit the NUT configuration.
 

gordon19284

Dabbler
Joined
Dec 13, 2021
Messages
14
There's no need to manually edit upsmon.conf. There's a convenient check box in the UPS service for this:

View attachment 55340

Just navigate to Services->UPS, and click the pencil icon to edit the NUT configuration.
Hi Samuel, thanks for the reply. In my initial post, I indicate that changing this setting does not fix the issue. No matter whether it's checked or not, the UPS gets powered down:

If the "Power Off UPS" setting is On, this line changes to /etc/killpower, and for off it's /etc/nokillpower. However, it doesn't seem to matter. Simply the presence of POWERDOWNFLAG causes the UPS to be sent the shutdown command.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
OK, this warrants a bug report.
 

gordon19284

Dabbler
Joined
Dec 13, 2021
Messages
14
Top