akitaonrails (owner)

Revisions

gist: 14049 Download_button fork
public
Description:
CentOS init script for Gitorious ultrasphinx
Public Clone URL: git://gist.github.com/14049.git
Embed All Files: show embed
Bash #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/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