From 2cae93e7cecbc1eb228bffc59670065cdae74a2e Mon Sep 17 00:00:00 2001 From: Louwrentius Date: Thu, 15 Apr 2010 22:13:02 +0000 Subject: [PATCH] Improved daemon mode, but may be buggy and display output is a mess. --- ppss | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ppss b/ppss index 25d8f01..a23d616 100755 --- a/ppss +++ b/ppss @@ -67,10 +67,6 @@ ARCH="`uname`" PPSS_HOME_DIR="ppss-home" PID="$$" -if [ -z "$INPUT_LOCK" ] -then - INPUT_LOCK="INPUT_LOCK" -fi GLOBAL_LOCK="$PPSS_DIR/PPSS-GLOBAL-LOCK-$PID" # Global lock file used by local PPSS instance. PAUSE_SIGNAL="$PPSS_HOME_DIR/$PPSS_DIR/pause_signal" # Pause processing if this file is present. PAUSE_DELAY="60" # Polling every 1 minutes by default. @@ -776,6 +772,11 @@ init_vars () { create_working_directory + if [ "$DAEMON" == "1" ] + then + INPUT_LOCK="$SRC_DIR/INPUT_LOCK" + fi + if [ "$ARCH" == "Darwin" ] then MIN_JOBS=4 @@ -1439,9 +1440,10 @@ lock_item () { get_input_lock () { + while true do - exec_cmd "mkdir -p $INPUT_LOCK" + exec_cmd "mkdir $INPUT_LOCK >> /dev/null 2>&1 " if [ "$?" == "0" ] then log DEBUG "Input lock is obtained..."