Created
July 7, 2013 09:47
-
-
Save mitsutaka/5942955 to your computer and use it in GitHub Desktop.
stone init script for Debian
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
. /lib/lsb/init-functions | |
NAME=stone | |
DAEMON=/usr/local/sbin/${NAME} | |
CONFIG=/etc/stone/stone.conf | |
PIDFILE=/var/run/${NAME}.pid | |
start() { | |
log_daemon_msg "Starting ${NAME}" | |
$DAEMON -D -C $CONFIG | |
RETVAL=$? | |
if [ $RETVAL -eq 0 ]; then | |
touch /var/lock/stone && log_success_msg "stone startup" | |
else | |
log_failure_msg "stone startup" | |
fi | |
echo | |
} | |
stop() { | |
log_daemon_msg "Stopping ${NAME}" | |
killall stone | |
RETVAL=$? | |
echo | |
rm -f /var/lock/stone | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
restart) | |
stop | |
start | |
;; | |
*) | |
echo "Usage: stone {start|stop|restart}" | |
exit 1 | |
esac | |
exit $RETVAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment