Added proper handling of start stop and continue for distributed processing.

This commit is contained in:
Louwrentius 2009-03-08 15:18:15 +00:00
parent 72331714c6
commit 2ca92a6542
1 changed files with 33 additions and 3 deletions

View File

@ -328,6 +328,7 @@ do
;; ;;
--node|-n ) --node|-n )
NODES_FILE="$2" NODES_FILE="$2"
add_var_to_config NODES_FILE "$NODES_FILE"
shift 2 shift 2
;; ;;
@ -579,7 +580,6 @@ erase_ppss () {
deploy_ppss () { deploy_ppss () {
ERROR=0 ERROR=0
set_error () { set_error () {
if [ ! "$1" == "0" ] if [ ! "$1" == "0" ]
@ -587,6 +587,13 @@ deploy_ppss () {
ERROR=$1 ERROR=$1
fi fi
} }
if [ -z "$NODES_FILE" ]
then
log INFO "ERROR - are you using the right option? -C ?"
cleanup
exit 1
fi
KEY=`echo $SSH_KEY | cut -d " " -f 2` KEY=`echo $SSH_KEY | cut -d " " -f 2`
if [ -z "$KEY" ] || [ ! -e "$KEY" ] if [ -z "$KEY" ] || [ ! -e "$KEY" ]
@ -1178,7 +1185,7 @@ main () {
LISTENER_PID=$! LISTENER_PID=$!
start_all_workers start_all_workers
;; ;;
server ) start )
# This option only starts all nodes. # This option only starts all nodes.
init_vars init_vars
@ -1206,7 +1213,30 @@ main () {
;; ;;
stop ) stop )
#some stop log INFO "Stopping PPSS on all nodes."
exec_cmd "touch $STOP_SIGNAL"
cleanup
exit
;;
pause )
log INFO "Pausing PPSS on all nodes."
exec_cmd "touch $PAUSE_SIGNAL"
cleanup
exit
;;
continue )
if does_file_exist "$STOP_SIGNAL"
then
log INFO "Continuing processing, please use $0 start to start PPSS on al nodes."
exec_cmd "rm -f $STOP_SIGNAL"
fi
if does_file_exist "$PAUSE_SIGNAL"
then
log INFO "Continuing PPSS on all nodes."
exec_cmd "rm -f $PAUSE_SIGNAL"
fi
cleanup
exit
;; ;;
deploy ) deploy )
deploy_ppss deploy_ppss