updated on Thu Jan 12 04:00:44 UTC 2012
[aur-mirror.git] / sphinx-release / sphinx.rc.d
blob64c8f01e74722b6a534266bce545f491cf479e50
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
5 . /etc/conf.d/sphinx
7 PID=$(pidof -o %PPID /usr/bin/sphinx-searchd)
8 case $1 in
9 start)
10 stat_busy "Starting Sphinx Daemon"
12 if [[ -z $PID ]] && /usr/bin/sphinx-searchd $SPHINX_ARGS; then
14 PID=$(pidof -o %PPID /usr/bin/sphinx-searchd)
15 echo "$PID" > /var/run/sphinx-searchd.pid
16 add_daemon sphinx
17 stat_done
18 else
19 stat_fail
20 exit 1
24 stop)
25 stat_busy "Stopping Sphinx Daemon"
26 if [[ ! -z $PID ]] && kill "$PID" &>/dev/null; then
27 rm_daemon sphinx
28 stat_done
29 else
30 stat_fail
31 exit 1
35 restart)
36 $0 stop
37 $0 start
41 echo "Usage: $0 {start|stop|restart}" >&2
42 exit 1
44 esac