#! /bin/sh # # skeleton example file to build /etc/init.d/ scripts. # This file should be used to construct scripts for /etc/init.d. # # Written by Miquel van Smoorenburg . # Modified for Debian # by Ian Murdock . # # update-rc.d sphinx start 21 2 . start 21 3 . start 21 4 . start 21 5 . stop 21 0 . stop 21 1 . stop 21 6 . # Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl # PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/dovecot/bin:/opt/sphinx/bin DAEMON=/opt/sphinx/bin/searchd OPTS="--config /opt/sphinx/etc/sphinx.conf" PIDFILE=/var/run/sphinx/searchd.pid NAME=searchd DESC=sphinx test -x $DAEMON || exit 0 set -e case "$1" in start) echo -n "Starting $DESC: " if start-stop-daemon --start --chuid sphinx:sphinx --pidfile $PIDFILE --exec $DAEMON -- $OPTS; then echo "$NAME." fi ;; stop) echo -n "Stopping $DESC: " if start-stop-daemon --stop --pidfile $PIDFILE --user sphinx; then rm -f $PIDFILE echo "$NAME." fi ;; index) echo -n "Indexing: " su - sphinx -c "/opt/sphinx/bin/indexer --all" ;; rotate) echo -n "Reindexing: " su - sphinx -c "/opt/sphinx/bin/indexer --all --rotate" ;; *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop|index|rotate}" >&2 #echo "Usage: $N {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0