File: //usr/share/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