Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- ### BEGIN INIT INFO
- # Provides: searchd
- # Required-Start: $remote_fs $syslog
- # Required-Stop: $remote_fs $syslog
- # Should-Start: $local_fs
- # Should-Stop: $local_fs
- # Default-Start: 2 3 4 5
- # Default-Stop: 0 1 6
- # Short-Description: Start searchd daemon
- # Description: Start up searchd, sphinx search daemon
- ### END INIT INFO
- PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
- pidfile=/run/sphinx/searchd.pid
- binpath=/usr/local/bin/searchd
- SPHINX="--config /etc/sphinxsearch/sphinx.conf"
- NAME=searchd
- DESC="sphinx search daemon"
- test -f $binpath || exit 0
- set -e
- . /lib/lsb/init-functions
- case "$1" in
- start)
- echo "Starting sphinx search daemon: searchd"
- start-stop-daemon --start --quiet --chuid 999 --group 999 --exec $binpath -- $SPHINX
- echo "."
- ;;
- stop)
- echo "Stopping sphinx search daemon: searchd"
- start-stop-daemon --stop --chuid 999 --group 999 --retry TERM/1/TERM/1/TERM/4/KILL --quiet --exec $binpath --pidfile $pidfile
- echo "."
- ;;
- restart|force-reload)
- echo "Restarting sphinx search daemon: searchd"
- start-stop-daemon --stop --chuid 999 --group 999 --retry TERM/1/TERM/1/TERM/4/KILL --quiet --exec $binpath --pidfile $pidfile
- start-stop-daemon --start --chuid 999 --group 999 --quiet --exec $binpath -- $SPHINX
- echo "."
- ;;
- status)
- status_of_proc -p $pidfile "${binpath}" "searchd"
- ;;
- *)
- echo "Usage: /etc/init.d/sphinx {start|stop|restart|force-reload|status}"
- exit 1
- esac
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement