Skip to content

Instantly share code, notes, and snippets.

@deoxxa
Created May 15, 2012 15:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deoxxa/2702446 to your computer and use it in GitHub Desktop.
Save deoxxa/2702446 to your computer and use it in GitHub Desktop.
SphinxSearch init script for debian/ubuntu
#!/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