backup, may be broken.

This commit is contained in:
Louwrentius 2010-07-12 21:37:49 +00:00
parent 55583de5f8
commit 5614724162

24
ppss
View File

@ -372,10 +372,10 @@ does_file_exist () {
RES=`exec_cmd "ls -1 $FILE" 2>&1` RES=`exec_cmd "ls -1 $FILE" 2>&1`
if [ "$?" = "0" ] if [ "$?" = "0" ]
then then
log DEBUG "$FILE does exist - $RES" log DEBUG "$FILE does exist"
return 0 return 0
else else
log DEBUG "$FILE does not exist - $RES" log DEBUG "$FILE does not exist"
return 1 return 1
fi fi
} }
@ -733,7 +733,7 @@ process_arguments () {
then then
showusage_short showusage_short
echo echo
echo "Daemon mode requires an argument to the -d option as a place to put the lock dir." echo "Daemon monitors a specified directory (with the -d option) for files to process."
echo "Read the on-line manual for more information." echo "Read the on-line manual for more information."
exit 1 exit 1
fi fi
@ -1742,7 +1742,7 @@ start_single_worker () {
# #
if ! are_we_sourced if ! are_we_sourced
then then
if [ "$DAEMON" = "1" ] if [ "$DAEMON" = "1" ] && [ "$INOTIFY" = "1" ]
then then
echo "$STOP_KEY" >> "$FIFO" echo "$STOP_KEY" >> "$FIFO"
return $? return $?
@ -2149,6 +2149,15 @@ inotify_listener () {
done done
} }
start_inotify_listener () {
ACTIVE_WORKERS=0
inotify_listener &
MYPID="$!"
disown
PIDS="$PIDS $MYPID"
}
listen_for_job () { listen_for_job () {
FINISHED=0 FINISHED=0
@ -2158,11 +2167,8 @@ listen_for_job () {
if [ "$DAEMON" = "1" ] && [ "$INOTIFY" = "1" ] if [ "$DAEMON" = "1" ] && [ "$INOTIFY" = "1" ]
then then
ACTIVE_WORKERS=0 log INFO "Linux inotify enabled."
inotify_listener & start_inotify_listener
MYPID="$!"
disown
PIDS="$PIDS $MYPID"
fi fi
while read event <& 42 while read event <& 42