Last change
on this file was
739,
checked in by lgiessmann, 13 years ago
|
trunk: shell_scrcipts: changed the defualt shell script for TextGrid?
|
-
Property svn:executable set to
*
|
File size:
1.3 KB
|
Line | |
---|
1 | |
---|
2 | #!/bin/bash |
---|
3 | |
---|
4 | ### BEGIN INIT INFO |
---|
5 | # Provides: isidorus |
---|
6 | # Required-Start: $local_fs $remote_fs $network |
---|
7 | # Required-Stop: $local_fs $remote_fs $network |
---|
8 | # Should-Start: $named |
---|
9 | # Should-Stop: $named |
---|
10 | # Default-Start: 2 3 4 5 |
---|
11 | # Default-Stop: 0 1 6 |
---|
12 | # Short-Description: Start Isidorus. |
---|
13 | # Description: Start the Isidorus server. |
---|
14 | ### END INIT INFO |
---|
15 | |
---|
16 | . /lib/lsb/init-functions |
---|
17 | |
---|
18 | NAME=isidorus |
---|
19 | DPATH=/home/isidorus/.sbcl/site/isidorus/src |
---|
20 | DAEMON="/usr/bin/sbcl" |
---|
21 | ARGUMENTS="--load shell_scripts/startIsidorus.lisp" |
---|
22 | PID=/var/run/isidorus.pid |
---|
23 | USER=isidorus |
---|
24 | GROUP=isidorus |
---|
25 | |
---|
26 | start_isidorus () { |
---|
27 | log_daemon_msg "Starting ${NAME}" |
---|
28 | #set -x |
---|
29 | start-stop-daemon --background --start --group ${GROUP} --chuid ${USER} --chdir ${DPATH} --pidfile ${PID} -m --exec ${DAEMON} -- ${ARGUMENTS} |
---|
30 | #set +x |
---|
31 | if ps -p $(cat $PID 2> /dev/null) > /dev/null 2>&1; then |
---|
32 | log_end_msg 0 |
---|
33 | else |
---|
34 | log_end_msg 1 |
---|
35 | fi |
---|
36 | } |
---|
37 | |
---|
38 | stop_isidorus () { |
---|
39 | log_daemon_msg "Stoping ${NAME}" |
---|
40 | |
---|
41 | . ${DPATH}/shell_scripts/shutdown-isidorus.sh |
---|
42 | if [ $? -eq 0 ]; then |
---|
43 | log_end_msg 0 |
---|
44 | else |
---|
45 | log_end_msg 1 |
---|
46 | fi |
---|
47 | } |
---|
48 | |
---|
49 | |
---|
50 | case "$1" in |
---|
51 | start) |
---|
52 | start_isidorus |
---|
53 | ;; |
---|
54 | |
---|
55 | stop) |
---|
56 | stop_isidorus |
---|
57 | ;; |
---|
58 | |
---|
59 | restart) |
---|
60 | stop_isidorus |
---|
61 | sleep 5 |
---|
62 | start_isidorus |
---|
63 | ;; |
---|
64 | |
---|
65 | status) |
---|
66 | echo TODO |
---|
67 | ;; |
---|
68 | |
---|
69 | *) |
---|
70 | echo "Usage: $0 {start|stop|restart|status}" >&2 |
---|
71 | exit 1 |
---|
72 | ;; |
---|
73 | esac; |
---|
Note: See
TracBrowser
for help on using the repository browser.