changeset 432:90512560ed4d

more with init scripts !
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 27 Aug 2010 17:41:33 +0200
parents ccbb7ea2b203
children aeafda5481e4
files hg_app_daemon hg_app_daemon2
diffstat 2 files changed, 12 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/hg_app_daemon	Fri Aug 27 15:25:23 2010 +0200
+++ b/hg_app_daemon	Fri Aug 27 17:41:33 2010 +0200
@@ -34,7 +34,7 @@
 start() {
     ebegin "Starting $APP_NAME"
     start-stop-daemon -d $APP_PATH -e PYTHON_EGG_CACHE="/tmp" \
-        --start --quiet\
+        --start --quiet \
         --pidfile $PID_PATH \
         --user $RUN_AS \
         --exec $DAEMON -- $DAEMON_OPTS
--- a/hg_app_daemon2	Fri Aug 27 15:25:23 2010 +0200
+++ b/hg_app_daemon2	Fri Aug 27 17:41:33 2010 +0200
@@ -39,13 +39,13 @@
   start)
     echo "Starting $APP_NAME"
     start-stop-daemon -d $APP_PATH -e PYTHON_EGG_CACHE="/tmp" \
-        --start --quiet\
+        --start --quiet \
         --pidfile $PID_PATH \
         --user $RUN_AS \
         --exec $DAEMON -- $DAEMON_OPTS
     ;;
   stop)
-    ebegin "Stopping $APP_NAME"
+    echo "Stopping $APP_NAME"
     start-stop-daemon -d $APP_PATH \
         --stop --quiet \
         --pidfile $PID_PATH || echo "$APP_NAME - Not running!"
@@ -55,18 +55,21 @@
     ;;
   restart)
     echo "Restarting $APP_NAME"
-    #stop
-    start-stop-daemon --stop --quiet \
+    ### stop ###
+    echo "Stopping $APP_NAME"
+    start-stop-daemon -d $APP_PATH \
+        --stop --quiet \
         --pidfile $PID_PATH || echo "$APP_NAME - Not running!"
     if [ -f $PID_PATH ]; then
         rm $PID_PATH
     fi
-    #start
-    start-stop-daemon --start --quiet\
+    ### start ###
+    echo "Starting $APP_NAME"
+    start-stop-daemon -d $APP_PATH -e PYTHON_EGG_CACHE="/tmp" \
+        --start --quiet \
         --pidfile $PID_PATH \
         --user $RUN_AS \
-        --exec $DAEMON -- $DAEMON_OPTS    
-    ;;
+        --exec $DAEMON -- $DAEMON_OPTS
   *)
     echo "Usage: $0 {start|stop|restart}"
     exit 1