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: //usr/share/init/s2s_daemon.conf
description "start s2s_daemon"

author "Cloud Application Team"

start on syno.share.ready and syno.network.ready
stop on runlevel [06]

respawn
respawn limit 5 10

console log
expect fork

normal exit 0

env MaxWatches=8192
env MaxQueueEvents=163840

pre-start script
	SupportS2S=`/bin/get_key_value /etc.defaults/synoinfo.conf support_s2s` || true
	if [ "yes" = "${SupportS2S}" -o "YES" = "${SupportS2S}"  ]; then
		MaxWatches=`/bin/get_key_value /etc.defaults/synoinfo.conf s2s_watches_max` || true

		if [[ -n "$MaxWatches" ]]; then
			echo $MaxWatches > /proc/sys/fs/inotify/max_user_watches || true
			echo $MaxQueueEvents > /proc/sys/fs/inotify/max_queued_events || true
		fi
	else
		stop; exit 0
	fi

	echo "Starting s2s_daemon"
end script

pre-stop script
	/usr/bin/killall s2s_syncer || true
end script

post-stop script
	echo "Stopped s2s_daemon"
end script

exec /usr/syno/bin/s2s_daemon -d
# vim:ft=upstart