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