This commit is contained in:
Louwrentius 2009-10-21 18:26:21 +00:00
parent fb3905ad11
commit e24cf063e9

24
ppss.sh
View File

@ -38,7 +38,7 @@ trap 'kill_process; ' INT
# Setting some vars. Do not change. # Setting some vars. Do not change.
SCRIPT_NAME="Distributed Parallel Processing Shell Script" SCRIPT_NAME="Distributed Parallel Processing Shell Script"
SCRIPT_VERSION="2.30" SCRIPT_VERSION="2.32"
# The first argument to this script is always the 'mode'. # The first argument to this script is always the 'mode'.
MODE="$1" MODE="$1"
@ -579,7 +579,7 @@ init_vars () {
if [ -z "$COMMAND" ] if [ -z "$COMMAND" ]
then then
echo echo
echo "ERROR - no command specified." log ERROR "No command specified."
echo echo
showusage showusage
cleanup cleanup
@ -623,7 +623,7 @@ init_vars () {
if [ ! "$?" == "0" ] if [ ! "$?" == "0" ]
then then
log DEBUG "Job log directory $JOB_lOG_DIR does not exist. Creating." log DEBUG "Job log directory $JOB_lOG_DIR does not exist. Creating."
exec_cmd "mkdir $JOB_LOG_DIR" exec_cmd "mkdir -p $JOB_LOG_DIR"
else else
log DEBUG "Job log directory $JOB_LOG_DIR exists." log DEBUG "Job log directory $JOB_LOG_DIR exists."
fi fi
@ -637,13 +637,13 @@ init_vars () {
if [ ! -e "$JOB_LOG_DIR" ] if [ ! -e "$JOB_LOG_DIR" ]
then then
mkdir "$JOB_LOG_DIR" mkdir -p "$JOB_LOG_DIR"
fi fi
does_file_exist "$REMOTE_OUTPUT_DIR" does_file_exist "$REMOTE_OUTPUT_DIR"
if [ ! "$?" == "0" ] if [ ! "$?" == "0" ]
then then
echo "ERROR: remote output dir $REMOTE_OUTPUT_DIR does not exist." log ERROR "Remote output dir $REMOTE_OUTPUT_DIR does not exist."
set_status STOPPED set_status STOPPED
cleanup cleanup
exit exit
@ -841,6 +841,7 @@ deploy_ppss () {
exit 1 exit 1
fi fi
INSTALLED_ON_SSH_SERVER=0
if [ ! -e "$NODES_FILE" ] if [ ! -e "$NODES_FILE" ]
then then
log ERROR "File $NODES with list of nodes does not exist." log ERROR "File $NODES with list of nodes does not exist."
@ -852,7 +853,17 @@ deploy_ppss () {
do do
deploy "$NODE" & deploy "$NODE" &
sleep 0.1 sleep 0.1
if [ "$NODE" == "$SSH_SERVER" ]
then
log DEBUG "SSH SERVER $SSH_SERVER is also a node."
INSTALLED_ON_SSH_SERVER=1
fi
done done
if [ "$INSTALLED_ON_SSH_SERVER" == "0" ]
then
log DEBUG "SSH SERVER $SSH_SERVER is not a node."
deploy "$SSH_SERVER"
fi
fi fi
} }
@ -1418,7 +1429,7 @@ commando () {
if [ ! -z "$SSH_SERVER" ] if [ ! -z "$SSH_SERVER" ]
then then
log DEBUG "Uploading item log file $ITEM_LOG_FILE to master ~/$PPSS_HOME_DIR/$JOB_LOG" log DEBUG "Uploading item log file $ITEM_LOG_FILE to master ~/$JOB_LOG"
scp -q $SSH_OPTS $SSH_KEY "$ITEM_LOG_FILE" $USER@$SSH_SERVER:~/$JOB_LOG_DIR scp -q $SSH_OPTS $SSH_KEY "$ITEM_LOG_FILE" $USER@$SSH_SERVER:~/$JOB_LOG_DIR
if [ ! "$?" == "0" ] if [ ! "$?" == "0" ]
then then
@ -1517,6 +1528,7 @@ show_status () {
TMP_NO=`cat $NODES_FILE | wc -l` TMP_NO=`cat $NODES_FILE | wc -l`
log INFO "Nodes:\t $TMP_NO" log INFO "Nodes:\t $TMP_NO"
fi fi
log INFO "Items:\t\t$ITEMS"
log INFO "---------------------------------------------------------" log INFO "---------------------------------------------------------"