Created
May 15, 2012 15:01
-
-
Save deoxxa/2702446 to your computer and use it in GitHub Desktop.
SphinxSearch init script for debian/ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# sphinx: | |
# Start the Sphinx search engine | |
SPHINX_BINARY=/usr/local/bin/sphinx-searchd | |
SPHINX_CONFIG=/usr/local/etc/sphinx/sphinx.conf | |
SPHINX_USER=sphinx | |
test -f $SPHINX_BINARY || exit 0 | |
case "$1" in | |
start) | |
echo "Starting Sphinx" | |
sudo -u $SPHINX_USER $SPHINX_BINARY --config $SPHINX_CONFIG | |
;; | |
stop) | |
echo "Stopping Sphinx" | |
sudo -u $SPHINX_USER $SPHINX_BINARY --config $SPHINX_CONFIG --stopwait | |
killall -w -q $SPHINX_BINARY | |
;; | |
restart) | |
$0 stop | |
$0 start | |
;; | |
*) | |
echo "Usage: /etc/init.d/$NAME {start|stop|restart}" | |
exit 1 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment