Bug #6571
closedNUT service can not start sometimes after boot when SNMP UPS interface is down
0%
Description
If NUT is started with SNMP UPS configured and UPS network or card is currently down, an error message appears
"ERROR: NUT is enabled, however the service is not running! The SNMP UPS may be unreachable. "
NUT service will never be restarted even if SNMP UPS interface is back and running.
Suggestion: restart NUT service automatically if it fails to start, for example every X minute.
Updated by Chris Buechler almost 8 years ago
- Target version deleted (
2.3.2) - Affected Version changed from 2.3.1 to All
Updated by Denny Page almost 8 years ago
I've taken a look at this, and this behavior appears to be an intentional choice on the part of the NUT team. I agree that it would be convenient if upsdrvctl offered an option to retry if initial startup fails. I would recommend exploring an enhancement request upstream with the NUT team. If nothing else, it would be worthwhile to learn the reasoning behind why they do not offer the functionality.
I may also take a look at adding external retry logic to the startup scripts in the new version of the nut package as a temporary work around.
Updated by Vladimir Suhhanov almost 8 years ago
I think the reason why this feature is not implemented by NUT team is because it should be implemented on the OS side, not service itself. It works on the windows, for example.
I think external scripting is absolutely OK for pfSense, just because it is. I am already using some code for check if NUT service running.
nut_check.sh started with cron every one minute or hour — does not matter. Echo is just for testing alone, you don't need it. The main problem my script is just piece of trash, because it's not universal and not automatically generated for every UPS installed, just because I don't know how to re-launch it correctly.
#!/bin/sh if ps ax | grep -v grep | grep "upsd -u root\|nut" | grep -v "nut_check.sh" then echo "nut is alive." else echo "nut is dead, but will be launched." /usr/local/sbin/upsd -u root sleep 3 /usr/local/libexec/nut/snmp-ups -a SMK-1000A sleep 3 /usr/local/sbin/upsmon SMK-1000A@localhost fi
Updated by Denny Page almost 8 years ago
The new NUT package allows for a nut supported way to retry the startup of the driver.
Updated by Denny Page almost 8 years ago
This is resolved with version 2.7.4_1 of the nut package.