updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / beanstalkd / beanstalkd.init
blob566ada0eca1c6793d827a3a030fa2ff1c37a6d99
1 #!/bin/bash
2 # Beanstalkd Archlinux rc.d script
4 # by Chien-An "Zero" Cho
5 # Copyright by hypo, Bigs Lab. (http://htpo.cc/)
7 . /etc/rc.conf
8 . /etc/rc.d/functions
9 . /etc/conf.d/beanstalkd
11 PID=`cat /var/run/beanstalkd.pid 2>/dev/null`
12 case "$1" in
13 start)
14 stat_busy "Starting Beanstalkd"
15 [ -z "$PID" ] && /usr/bin/beanstalkd $BEANSTALKD_ARGS
16 if [ $? -gt 0 ]; then
17 stat_fail
18 else
19 add_daemon beanstalkd
20 stat_done
23 stop)
24 stat_busy "Stopping beanstalkd"
25 [ ! -z "$PID" ] && kill $PID &> /dev/null
26 if [ $? -gt 0 ]; then
27 stat_fail
28 else
29 rm_daemon beanstalkd
30 stat_done
33 restart)
34 $0 stop
35 sleep 1
36 $0 start
39 echo "usage: $0 {start|stop|restart}"
40 esac
41 exit 0