Created
February 3, 2015 06:59
-
-
Save seyfer/f5384b76c8fd258dffdd to your computer and use it in GitHub Desktop.
Gearman Daemon init.d 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 | |
# Gearman server and library | |
# Copyright (C) 2013 Mostafa Amiri | |
# All rights reserved. | |
# | |
# Use and distribution licensed under the BSD license. See | |
# the COPYING file in this directory for full text. | |
NAME=gearmand | |
DAEMON=/usr/local/sbin/gearmand | |
PIDFILE=/var/run/gearmand.pid | |
LOGFILE=/var/log/gearmand.log | |
[ -x $DAEMON ] || exit 0 | |
start() | |
{ | |
$DAEMON -d -P $PIDFILE -l $LOGFILE | |
} | |
stop() | |
{ | |
kill `cat $PIDFILE` | |
rm -f $PIDFILE | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
restart) | |
stop | |
start | |
;; | |
status) | |
echo -n "${NAME} is " | |
if start-stop-daemon --stop --quiet --signal 0 --name ${NAME} --pidfile ${PIDFILE} | |
then | |
echo "running" | |
else | |
echo "not running" | |
exit 1 | |
fi | |
;; | |
*) | |
echo "Usage: $0 {start|stop|restart|status}" | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment