3 # gearmand Startup script for the Gearman server
6 # description: Gearman is a distributed job system.
7 # processname: gearmand
8 # config: /etc/sysconfig/gearmand
9 # pidfile: /var/run/gearmand/gearmand.pid
13 # Required-Start: $local_fs $network
14 # Required-Stop: $local_fs $network
17 # Short-Description: start and stop the Gearman server
18 # Description: Gearman is a distributed job system.
21 # Source function library.
22 . /etc/rc.d/init.d/functions
24 if [ -f /etc/sysconfig/gearmand ]; then
25 . /etc/sysconfig/gearmand
28 [ -z "${PIDFILE}" ] && pidfile="/var/run/gearmand/gearmand.pid"
29 [ -z "${LOCKFILE}" ] && lockfile="/var/lock/subsys/gearmand"
31 gearmand=/usr/sbin/gearmand
37 echo -n $"Starting $prog: "
38 daemon --pidfile=$pidfile --user=gearmand $gearmand -d $OPTIONS
41 [ $RETVAL = 0 ] && (touch $lockfile; pgrep -f $gearmand > $pidfile)
46 echo -n $"Stopping $prog: "
47 killproc -p $pidfile $gearmand
50 [ $RETVAL = 0 ] && rm -f $lockfile $pidfile
53 # See how we were called.
62 status -p $pidfile $gearmand
69 condrestart|try-restart)
70 if status -p $pidfile $gearmand >&/dev/null; then
76 echo $"Usage: $prog {start|stop|restart|reload|condrestart|status|help}"