File: //proc/25635/root/lib/systemd/scripts/s2s_starter.sh
#!/bin/bash
PreStart() {
env MaxWatches=8192
env MaxQueueEvents=163840
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
exit -1
fi
echo "Starting s2s_daemon"
}
PostStop() {
echo "Stopped s2s_daemon"
}
Execute() {
/usr/syno/bin/s2s_daemon -d
}
case $1 in
pre-start)
PreStart
;;
post-stop)
PostStop
;;
execute)
Execute
;;
esac
exit 0