[Nut-upsuser] Synology NAS is shutting down Ubuntu servers after very brief power outage (fwd)

Roger Price roger at rogerprice.org
Wed Aug 12 07:27:52 BST 2020

On Wed, 12 Aug 2020, Manuel Wolfshant wrote:

> So nut on Synology believes that it is a good idea to trigger a FSD 30 secs 
> AFTER switching back to line power when in fact it should CANCEL any shutdown 
> in progress. Unless you have the willingness to search & fix whatever 
> stupidities they do in their unorthodox use of nut... just use a sane version

Agreed. Could this be the cause of the unexpected shutdowns? In Synology's 
function UPSShutdown :

 	while [ $OL -ne 2 -a $LB -ne 2 ]; do
 		sleep 10

Function UPSStatusGet returns the current value of ups.status. Consider the case 
where upsc returns [OL CHRG], the following code will set LB to 2 after 20 sec 
even though the UPS is online.

 		if [ "$St" = "OL" ]; then
 			OL=`expr $OL + 1`
 			LB=`expr $LB + 1`
 		echo "OL=$OL LB=$LB" >> $SZF_SAFEMODE
 	if [ $OL -eq 2 ]; then
 		synologset1 sys warn 0x11300012
 		echo "UPS back to On-Line and reboot." >> $SZF_SAFEMODE
 		$SYNOBOOTBIN --unset-safe-shutdown
 		telinit 6

The following code is executed leading to a shutdown via the flag SZF_SAFEMODE:

 	elif [ $LB -eq 2 ]; then
 		touch /var/.NormalShutdown
 		if [ $UPSSafeShutdown -eq 0 ]; then
 			echo "Waiting UPS exhausted." >> $SZF_SAFEMODE
 			SYSLOG "Waiting UPS exhausted."
 			echo "UPS safe shutdown." >> $SZF_SAFEMODE
 			SYSLOG "UPS safe shutdown."

I will write a more complete report on Synology's Safe Mode, but I would 
recommend treating the NAS as a slave and running a correctly configured NUT in 
one of the Ubuntu machines.  Todd, if you need more detailed examples of NUT 
configurations, see http://rogerprice.org/NUT/ConfigExamples.A5.pdf


More information about the Nut-upsuser mailing list