-
44c8f9d3 :Anonymous
2013-07-14 18:25
-
んじゃinit.d用を公開するわ。Raspberry Piで作動ちう。
#!/bin/sh
### BEGIN INIT INFO
# Provides: saku
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start or stop the SAKU server
### END INIT INFO
#
# start/stop SAKU server.
set -e
PATH=/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
USER=shingetu
COMMAND=/usr/local/bin/saku
PIDDIR=/var/run
PIDFILE=$PIDDIR/saku.pid
test -x $COMMAND || exit 0
case "$1" in
start)
echo -n "Starting p2p bbs: saku"
start-stop-daemon --start --pidfile $PIDFILE --make-pidfile --background \
--exec $COMMAND --user $USER --chuid $USER --group $USER
echo "."
;;
stop)
echo -n "Stopping p2p bbs: saku"
setsid start-stop-daemon --stop --oknodo --pidfile $PIDFILE
echo "."
;;
restart|force-reload)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart|force-reload}"
exit 1
;;
esac
exit 0
Powered by shinGETsu.