#! /bin/sh # sphinx Startup script for sphinx # # chkconfig: - 86 14 # description: sphinx search daemon # # Author: Gabriel Handford http://ducktyper.com set -e PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DESC="sphinx daemon" NAME=searchd DAEMON=<%= sphinx_bin_path %>/searchd CONFIGFILE=<%= sphinx_conf_path %> PIDFILE=<%= sphinx_pid_path %> start() { $DAEMON --config $CONFIGFILE || echo -n " already running" } stop() { kill -QUIT `cat $PIDFILE` || echo -n " not running" } reload() { kill -HUP `cat $PIDFILE` || echo -n " can't reload" } case "$1" in start) echo -n "Starting $DESC: $NAME" start ;; stop) echo -n "Stopping $DESC: $NAME" stop ;; reload) echo -n "Reloading $DESC configuration..." reload echo "reloaded." ;; restart) echo -n "Restarting $DESC: $NAME" stop # Sleep sleep 1 start ;; *) echo "Usage: $0 {start|stop|restart|reload}" >&2 exit 3 ;; esac exit 0