3 # gearmand Startup script for the Gearman server
7 # description: Gearman is a distributed job system.
8 # processname: gearmand
9 # config: /etc/sysconfig/gearmand
10 # pidfile: /var/run/gearmand/gearmand.pid
13 # Source function library
14 . /etc/rc.d/init.d/functions
17 . /etc/sysconfig/network
19 # Check that networking is up.
20 if is_yes "${NETWORKING}"; then
21 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
22 msg_network_down "Gearmand job server"
32 # Get service config - may override defaults
33 [ -f /etc/sysconfig/gearmand ] && . /etc/sysconfig/gearmand
35 pidfile="/var/run/gearmand/gearmand.pid"
36 lockfile="/var/lock/subsys/gearmand"
37 gearmand="/usr/sbin/gearmand"
41 # Check if the service is already running?
42 if [ -f $lockfile ]; then
43 msg_already_running "Gearmand job server"
47 msg_starting "Gearmand job server"
48 daemon --pidfile $pidfile $gearmand -d --user=gearmand --pid-file=$pidfile $OPTIONS
50 [ $RETVAL -eq 0 ] && touch $lockfile
54 if [ ! -f $lockfile ]; then
55 msg_not_running "Gearmand job server"
60 msg_stopping "Gearmand job server"
61 killproc --pidfile $pidfile $procname -TERM
66 if [ ! -f $lockfile ]; then
67 msg_not_running "Gearmand job server"
77 # See how we were called.
96 status --pidfile $pidfile $procname
100 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"