Skip to content

Instantly share code, notes, and snippets.

@akitaonrails
Created October 1, 2008 07:35
Show Gist options
  • Save akitaonrails/14049 to your computer and use it in GitHub Desktop.
Save akitaonrails/14049 to your computer and use it in GitHub Desktop.
CentOS init script for Gitorious ultrasphinx
#!/bin/bash
#
# Init file for Gitorious Ultrasphinx daemon
#
# chkconfig: 2345 55 25
# description: Ultrasphinx server daemon
#
# processname: searchd
# pidfile: /var/www/gitorious/db/sphinx/log/searchd.pid
RETVAL=0
START_CMD="cd /var/www/gitorious/ && rake ultrasphinx:daemon:start RAILS_ENV=production"
STOP_CMD="cd /var/www/gitorious/ && rake ultrasphinx:daemon:stop RAILS_ENV=production"
RESTART_CMD="cd /var/www/gitorious/ && rake ultrasphinx:daemon:restart RAILS_ENV=production"
STATUS_CMD="cd /var/www/gitorious/ && rake ultrasphinx:daemon:status RAILS_ENV=production"
LOCK_FILE=/var/lock/git-ultrasphinx
PID_FILE=/var/www/gitorious/db/sphinx/log/searchd.pid
case "$1" in
start)
/bin/su - git -c "$START_CMD"
;;
stop)
/bin/su - git -c "$STOP_CMD"
;;
status)
/bin/su - git -c "$STATUS_CMD"
;;
restart)
/bin/su - git -c "$RESTART_CMD"
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
RETVAL=1
esac
exit $RETVAL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment