[Erp5-report] r42667 jm - /erp5/trunk/utils/erp5.recipe.cloudoooinstance/src/erp5/recipe/cl...
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Jan 25 18:30:05 CET 2011
Author: jm
Date: Tue Jan 25 18:30:05 2011
New Revision: 42667
URL: http://svn.erp5.org?rev=42667&view=rev
Log:
cloudoooctl: shutdown cloudooo instance properly
Modified:
erp5/trunk/utils/erp5.recipe.cloudoooinstance/src/erp5/recipe/cloudoooinstance/cloudoooctl.in
Modified: erp5/trunk/utils/erp5.recipe.cloudoooinstance/src/erp5/recipe/cloudoooinstance/cloudoooctl.in
URL: http://svn.erp5.org/erp5/trunk/utils/erp5.recipe.cloudoooinstance/src/erp5/recipe/cloudoooinstance/cloudoooctl.in?rev=42667&r1=42666&r2=42667&view=diff
==============================================================================
--- erp5/trunk/utils/erp5.recipe.cloudoooinstance/src/erp5/recipe/cloudoooinstance/cloudoooctl.in [utf8] (original)
+++ erp5/trunk/utils/erp5.recipe.cloudoooinstance/src/erp5/recipe/cloudoooinstance/cloudoooctl.in [utf8] Tue Jan 25 18:30:05 2011
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/sh -e
cloudooo_CONFIG_FILE="${:conf-output}"
@@ -15,25 +15,24 @@ start() {
}
stop() {
- if [ -f $PID ];
- then
- kill -1 `cat $PID`;
- $PASTER_PATH serve $cloudooo_CONFIG_FILE --stop-daemon \
- --pid-file=$PID;
+ if [ -f $PID ]; then
+ pid=`cat $PID`
+ kill -HUP $pid
+ for x in `seq 1 10`; do
+ kill -0 $pid 2>/dev/null || break
+ ! sleep 1
+ done || ! echo " failed to stop cloudooo within 10 seconds"
fi
}
+
status(){
$PASTER_PATH serve $cloudooo_CONFIG_FILE --status \
--pid-file=$PID;
}
case "$1" in
- start)
- start;;
- stop)
- stop;;
- status)
- status;;
+ start|stop|status)
+ $1;;
restart)
stop;
start;;
@@ -43,4 +42,3 @@ case "$1" in
*)
exec $PASTER_PATH serve $cloudooo_CONFIG_FILE;;
esac
-exit
More information about the Erp5-report
mailing list