Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
No-load Shutdown
If the UPS is operating on battery power and detects that the connected equipment is using less than 15 W of energy for more than 15 minutes, it will shut down to conserve energy.
When the UPS is reconnected to AC power, the UPS will automatically switch on.
As for you test: which UPS do you have? I have been reading what constitutes the user manuals for my two APC models and they have different features.
Brave Soul reportingA bit of searching in DSM 7 and I find this at line 42 onwards in/usr/syno/bin/synoups
Bash:UPSSafeShutdown=`/bin/get_key_value $SYNOUPS_CONF ups_safeshutdown` case "${UPSSafeShutdown}" in [Nn][Oo]) UPSSafeShutdown=0;; [Yy][Ee][Ss]) UPSSafeShutdown=1;; *) UPSSafeShutdown=0;; esac
Then from line 117
Bash:if [ $UPSSafeShutdown -eq 0 ]; then echo "Waiting UPS exhausted." >> $SZF_SAFEMODE SYSLOG "Waiting UPS exhausted." else echo "UPS safe shutdown." >> $SZF_SAFEMODE SYSLOG "UPS safe shutdown." shutdown_retry=0 while [ $shutdown_retry -ne 3 ]; do StopUps /usr/bin/upsdrvctl shutdown if [ $? -eq 0 ]; then return 0 fi shutdown_retry=`expr $shutdown_retry + 1` echo "UPS shutdown retry ... $shutdown_retry" >> $SZF_SAFEMODE echo "UPS shutdown retry ... $shutdown_retry" > /dev/kmsg # omron driver will reset usb (~30s) when command timeout sleep 40 done echo "UPS shutdown fail." >> $SZF_SAFEMODE echo "UPS shutdown fail" > /dev/kmsg fi
Going backwards through sourced/usr/syno/bin/synoupscommon
gets us to/usr/syno/etc/ups/synoups.conf
which, for me has this
Bash:Password: ups_enabled="yes" ups_mode="usb" ups_safeshutdown="no" ups_acl="<other NAS IP>|||||"
Looking in DSM 6 these parameters were in/etc/synoinfo.conf
and I didn't seeups_safeshutdown
in my file. But in DSM 6 the test was this... assume we can shutdown the UPS unless parameter exists and set to "no".
Bash:UPSSafeShutdown=`/bin/get_key_value $SYNOUPS_CONF ups_safeshutdown` case "${UPSSafeShutdown}" in [Nn][Oo]) UPSSafeShutdown=0;; *) UPSSafeShutdown=1;; esac
So we haveups_safeshutdown
in both files. And if I set it to "yes" in synoups.conf this does not survive the UPS feature being switched off/on in Control Panel. No idea of other times it would poll the UPS and determine it must be "no". So the script seems the best place to place a hack.
Bash:[Nn][Oo]) UPSSafeShutdown=1;;
Any brave souls?
If you rely on the NAS as an snmp UPS server, the connected slaves will shutdown even if power comes back before the timer expires. Worse, until you restart the UPS service on the NAS, you will not be able to restart the connected slaves as they will always shutdown right after rebooting.
That follows the post from @DickBlonov ... apparently Synology's UPS programming changes have some ill effects.whenever restarted they would just shutdown again
case "$1" in
online)
SynoUpsStateLog "synoups online"
UPSRestart
;;
onbatt)
SynoUpsStateLog "synoups onbatt"
ONBatt
;;
lowbatt)
SynoUpsStateLog "synoups lowbatt"
UPSLowBattCheck
UPSSafeMode $1
;;
nocomm)
SynoUpsStateLog "synoups nocomm"
UPSSafeMode $1
;;
fsd)
SynoUpsStateLog "synoups fsd"
/usr/sbin/upsmon -c fsd
UPSSafeMode $1
;;
shutdownups)
SynoUpsStateLog "synoups shutdownups"
UPSShutdown
;;
status)
SynoUpsStateLog "synoups status"
UPSStatusGet
;;
waittimeup)
SynoUpsStateLog "synoups waittimeup"
UPSWaitTimeUp
# /usr/sbin/upsmon -c fsd
UPSSafeMode $1
;;
statelog)
SynoUpsStateLog "synoups statelog"
;;
esac
This is caused by the change they made to the timer nameAdd me to this. I had done my quarterly UPS test and I have to Raspberry Pi's running as slaves, cut off mains for two minutes, restored mains and a minute later both Pi's shutdown and whenever restarted they would just shutdown again. Had to pull SD cards and disable NUT on them.
That will prevent your slaves from shutting down in a real power outage. The issue really is the name of the timer (waittimeup). I was previously called fsd, and was changed to waittimeup:You aren't kidding, this is one dangerous situation where all slaves will just keep shutting down. What I have done since reading this thread and poking around in the config is commented out a the fsd commands to the UPS monitor that seems to be the culprit.
/usr/syno/bin/synoups line 263:
Bash:case "$1" in online) SynoUpsStateLog "synoups online" UPSRestart ;; onbatt) SynoUpsStateLog "synoups onbatt" ONBatt ;; lowbatt) SynoUpsStateLog "synoups lowbatt" UPSLowBattCheck UPSSafeMode $1 ;; nocomm) SynoUpsStateLog "synoups nocomm" UPSSafeMode $1 ;; fsd) SynoUpsStateLog "synoups fsd" /usr/sbin/upsmon -c fsd UPSSafeMode $1 ;; shutdownups) SynoUpsStateLog "synoups shutdownups" UPSShutdown ;; status) SynoUpsStateLog "synoups status" UPSStatusGet ;; waittimeup) SynoUpsStateLog "synoups waittimeup" UPSWaitTimeUp # /usr/sbin/upsmon -c fsd UPSSafeMode $1 ;; statelog) SynoUpsStateLog "synoups statelog" ;; esac
115 AT ONLINE * EXECUTE online
116 #AT ONLINE * CANCEL-TIMER fsd
117 AT ONLINE * CANCEL-TIMER waittimeup online # the line I added
118 AT LOWBATT * EXECUTE lowbatt
119 AT NOCOMM * EXECUTE nocomm
120 AT FSD * EXECUTE fsd
121 AT ONBATT * EXECUTE onbatt
122 AT ONBATT * START-TIMER waittimeup 900 #<--- added by the GUI script
This is caused by the change they made to the timer name
That will prevent your slaves from shutting down in a real power outage. The issue really is the name of the timer (waittimeup). I was previously called fsd, and was changed to waittimeup:
File: /etc/ups/upssched.conf
I commented out the line referring to the old timer name and added a new one with the proper name
Bash:115 AT ONLINE * EXECUTE online 116 #AT ONLINE * CANCEL-TIMER fsd 117 AT ONLINE * CANCEL-TIMER waittimeup online # the line I added 118 AT LOWBATT * EXECUTE lowbatt 119 AT NOCOMM * EXECUTE nocomm 120 AT FSD * EXECUTE fsd 121 AT ONBATT * EXECUTE onbatt 122 AT ONBATT * START-TIMER waittimeup 900 #<--- added by the GUI script
Tested fine with a brownout (the timer gets cancelled and the FSD command is aborted).
Of course, if the timer expires, the slaves will shutdown properly now.
Here's a log from one of the slaves:
Sep 01 08:48:04 carp upsmon[898]: UPS [email protected] on battery
Sep 01 08:49:09 carp upsmon[898]: UPS [email protected] on line power
Sep 06 07:22:38 carp upsmon[898]: UPS [email protected] on battery
Sep 06 07:22:48 carp upsmon[898]: UPS [email protected] on line power
And the NAS log:
2021-09-01T08:48:05-04:00 SUSHI upsmsg[6252]: UPS on battery.
2021-09-01T08:49:12-04:00 SUSHI upsmsg[6531]: UPS back online, not in safe mode
2021-09-06T07:22:35-04:00 SUSHI upsmsg[29683]: UPS on battery.
2021-09-06T07:22:47-04:00 SUSHI upsmsg[29823]: UPS back online, not in safe mode
Phil
If you make the edits suggested by @DickBlonov , then restart your primary NAS, I understand all will be fixed... until the next DSM update. Yes?after seeeing the apcupsd monitor status i want to check if there is another fix for this. not sure what to do now. don't want to scramble all that data on this unit attempting the incorrect fix.
We use essential cookies to make this site work, and optional cookies to enhance your experience.