1 | #!/bin/bash |
---|
2 | |
---|
3 | # Author: James Casbon, 2009 |
---|
4 | |
---|
5 | ### BEGIN INIT INFO |
---|
6 | # Provides: galaxy |
---|
7 | # Required-Start: $network $local_fs $mysql |
---|
8 | # Required-Stop: |
---|
9 | # Default-Start: 2 3 4 5 |
---|
10 | # Default-Stop: 0 1 6 |
---|
11 | # Short-Description: Galaxy |
---|
12 | ### END INIT INFO |
---|
13 | |
---|
14 | . /lib/lsb/init-functions |
---|
15 | |
---|
16 | USER="galaxy" |
---|
17 | GROUP="nogroup" |
---|
18 | DIR="/home/galaxy/galaxy_dist/" |
---|
19 | PYTHON="/usr/bin/python" |
---|
20 | OPTS="-ES ./scripts/paster.py serve --log-file /home/galaxy/galaxy.log universe_wsgi.ini" |
---|
21 | PIDFILE="/var/run/galaxy.pid" |
---|
22 | |
---|
23 | case "${1:-''}" in |
---|
24 | 'start') |
---|
25 | log_daemon_msg "Starting Galaxy" |
---|
26 | if start-stop-daemon --chuid $USER --group $GROUP --start --make-pidfile \ |
---|
27 | --pidfile $PIDFILE --background --chdir $DIR --exec $PYTHON -- $OPTS; then |
---|
28 | log_end_msg 0 |
---|
29 | else |
---|
30 | log_end_msg 1 |
---|
31 | fi |
---|
32 | |
---|
33 | ;; |
---|
34 | 'stop') |
---|
35 | log_daemon_msg "Stopping Galaxy" |
---|
36 | if start-stop-daemon --stop --pidfile $PIDFILE; then |
---|
37 | log_end_msg 0 |
---|
38 | else |
---|
39 | log_end_msg 1 |
---|
40 | fi |
---|
41 | ;; |
---|
42 | 'restart') |
---|
43 | # restart commands here |
---|
44 | $0 stop |
---|
45 | $0 start |
---|
46 | |
---|
47 | ;; |
---|
48 | *) # no parameter specified |
---|
49 | echo "Usage: $SELF start|stop|restart|reload|force-reload|status" |
---|
50 | exit 1 |
---|
51 | ;; |
---|
52 | esac |
---|
53 | |
---|
54 | |
---|
55 | |
---|