[Erp5-report] r11459 - /erp5/trunk/utils/oood/oood.rc
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Nov 23 17:06:49 CET 2006
Author: kevin
Date: Thu Nov 23 17:06:47 2006
New Revision: 11459
URL: http://svn.erp5.org?rev=11459&view=rev
Log:
Use script-side switch to kill and manage server startup.
Show server status and statistics.
Modified:
erp5/trunk/utils/oood/oood.rc
Modified: erp5/trunk/utils/oood/oood.rc
URL: http://svn.erp5.org/erp5/trunk/utils/oood/oood.rc?rev=11459&r1=11458&r2=11459&view=diff
==============================================================================
--- erp5/trunk/utils/oood/oood.rc (original)
+++ erp5/trunk/utils/oood/oood.rc Thu Nov 23 17:06:47 2006
@@ -29,15 +29,15 @@
# Initialize the Pool
python $HOME/start.py --init > /dev/null 2>&1 /dev/null
# Start the server in the background
- python $HOME/runserw.py > /dev/null &
- sleep 2
- PID=`cat $PIDFILE`
- echo $PID
- if [ $PID ]; then
+ python $HOME/runserw.py --start > /dev/null &
+ sleep 10 # Safe sleep to let the server create its lockfile
+ # Warning: this trick should be replaced by a stronger mechanism,
+ # because under heavy load, the server can take several tenth of
+ # seconds to start. This case should be handled in runserw.py script.
+ if [ -f $PIDFILE ]; then
echo_success
else
gprintf "%s is not running (no pid file found)." "$NAME"
- killproc "python $HOME/runserw.py"
python $HOME/start.py --flush > /dev/null 2>&1 /dev/null
echo_failure
fi
@@ -51,17 +51,20 @@
echo_failure
else
gprintf "Stopping %s daemon: " "$NAME"
- killproc "python $HOME/runserw.py" && echo_success || echo_failure
+ python $HOME/runserw.py --stop && echo_success || echo_failure
fi
# Clean up in any case
- rm -f $LOCKFILE
python $HOME/start.py --flush > /dev/null 2>&1 /dev/null
echo
}
status() {
- python $HOME/start.py --status
+ echo
+ python $HOME/runserw.py --status
+ echo
+ python $HOME/start.py --status
+ echo
}
More information about the Erp5-report
mailing list