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.defaults/init/synorelayd.conf
description	"start synorelayd"
author "Cloud Service Team"

console log
start on runlevel 2
stop on runlevel [06]

expect daemon
respawn
respawn limit 5 10
kill timeout 15

pre-start script
	chmod 644 /usr/syno/etc/synorelayd/*.conf || true
end script

exec /usr/syno/sbin/synorelayd

pre-stop script
        if [ -f "/tmp/DebugShutdown" ]; then
                start
        fi
end script

post-stop script
	# make sure runlevel is 0 (poweroff)
	run_level=`runlevel | awk '{ printf $2 }'` || true
	if [ "x${run_level}" != "x0" ]; then
		exit 0
	fi

	if ! /usr/syno/sbin/synoservice --is-enable synorelayd > /dev/null 2>&1 ; then
		count=30
		while [ $count -gt 0 ]; do
			if /usr/syno/sbin/synorelayd -b down > /dev/null 2>&1 ; then
				break;
			fi
			sleep 1
			count=`expr $count - 1` || true
		done
	fi
end script