HEX
Server: Apache/2.2.34 (Unix) mod_fastcgi/mod_fastcgi-SNAP-0910052141
System: Linux Kou-Etsu-Dou 4.4.59+ #25556 SMP PREEMPT Thu Mar 4 18:03:46 CST 2021 x86_64
User: hosam (1026)
PHP: 7.2.29
Disabled: NONE
Upload Files
File: //etc/init/reboot.conf
description	"Synology reboot"

start on runlevel 6 and stopped umount-root-fs and umount-root-ok 
stop on runlevel [!6]

task

console none

script
	## make sure runlevel is not 0 (poweroff)
	run_level=`runlevel | awk '{ printf $2 }'` || true
	if [ "x${run_level}" = "x0" ]; then
		echo "incorrect runlevel, skip reboot"
		exit 0
	fi

	if [ -e /tmp/ha_force_reboot ]; then
		# Will hang if reboot normally here
		# See OCF synoha:drbd
		echo b > /proc/sysrq-trigger
	else
		SupportDualhead=`/bin/get_key_value /etc.defaults/synoinfo.conf support_dual_head` || true
		if [ "$SupportDualhead" = "yes" ]; then
			if [ -f "`/usr/syno/synoaha/bin/synoahastr --switchover`" ]; then
				/usr/syno/synoaha/bin/synoaha --ask-remote-promote || true
			fi
		fi
		if /bin/get_key_value /etc.defaults/synoinfo.conf unique | /bin/grep broadwellntb; then
			/sbin/ifconfig ntb_eth0 down || true
		fi

		/sbin/reboot -f
	fi
end script
# vim:ft=upstart