Show More
@@ -1,6 +1,6 b'' | |||
|
1 | 1 | #!/bin/sh -e |
|
2 | 2 | ######################################## |
|
3 |
#### THIS IS A |
|
|
3 | #### THIS IS A DEBIAN INIT.D SCRIPT #### | |
|
4 | 4 | ######################################## |
|
5 | 5 | |
|
6 | 6 | ### BEGIN INIT INFO |
@@ -35,43 +35,42 b' DAEMON_OPTS="serve --daemon \\' | |||
|
35 | 35 | --log-file=$LOG_PATH $APP_PATH/$CONF_NAME" |
|
36 | 36 | |
|
37 | 37 | |
|
38 | case "$1" in | |
|
39 | start) | |
|
38 | start() { | |
|
40 | 39 |
|
|
41 | start-stop-daemon -d $APP_PATH -e PYTHON_EGG_CACHE="/tmp" \ | |
|
40 | PYTHON_EGG_CACHE="/tmp" start-stop-daemon -d $APP_PATH \ | |
|
42 | 41 |
|
|
43 | 42 |
|
|
44 | 43 |
|
|
45 | 44 |
|
|
46 | ;; | |
|
47 | stop) | |
|
45 | } | |
|
46 | ||
|
47 | stop() { | |
|
48 | 48 |
|
|
49 | 49 |
|
|
50 | 50 |
|
|
51 | 51 |
|
|
52 | ||
|
52 | 53 |
|
|
53 | 54 |
|
|
54 | 55 |
|
|
56 | } | |
|
57 | ||
|
58 | case "$1" in | |
|
59 | start) | |
|
60 | start | |
|
61 | ;; | |
|
62 | stop) | |
|
63 | stop | |
|
55 | 64 | ;; |
|
56 | 65 | restart) |
|
57 | 66 | echo "Restarting $APP_NAME" |
|
58 | 67 | ### stop ### |
|
59 | echo "Stopping $APP_NAME" | |
|
60 | start-stop-daemon -d $APP_PATH \ | |
|
61 | --stop --quiet \ | |
|
62 | --pidfile $PID_PATH || echo "$APP_NAME - Not running!" | |
|
63 | if [ -f $PID_PATH ]; then | |
|
64 | rm $PID_PATH | |
|
65 | fi | |
|
68 | stop | |
|
69 | wait | |
|
66 | 70 | ### start ### |
|
67 | echo "Starting $APP_NAME" | |
|
68 | start-stop-daemon -d $APP_PATH -e PYTHON_EGG_CACHE="/tmp" \ | |
|
69 | --start --quiet \ | |
|
70 | --pidfile $PID_PATH \ | |
|
71 | --user $RUN_AS \ | |
|
72 | --exec $DAEMON -- $DAEMON_OPTS | |
|
71 | start | |
|
73 | 72 | ;; |
|
74 | 73 | *) |
|
75 | 74 | echo "Usage: $0 {start|stop|restart}" |
|
76 | 75 | exit 1 |
|
77 | esac No newline at end of file | |
|
76 | esac |
General Comments 0
You need to be logged in to leave comments.
Login now