From: <abe...@us...> - 2016-12-22 19:14:20
|
Revision: 8051 http://sourceforge.net/p/astlinux/code/8051 Author: abelbeck Date: 2016-12-22 19:14:18 +0000 (Thu, 22 Dec 2016) Log Message: ----------- arnofw, adaptive-ban plugin, fix a bug when syslogd rotates /var/log/messages and does not create a new /var/log/messages which caused the adaptive-ban helper script to exit Modified Paths: -------------- branches/1.0/package/arnofw/adaptive-ban/adaptive-ban-helper.sh Modified: branches/1.0/package/arnofw/adaptive-ban/adaptive-ban-helper.sh =================================================================== --- branches/1.0/package/arnofw/adaptive-ban/adaptive-ban-helper.sh 2016-12-21 21:14:32 UTC (rev 8050) +++ branches/1.0/package/arnofw/adaptive-ban/adaptive-ban-helper.sh 2016-12-22 19:14:18 UTC (rev 8051) @@ -56,7 +56,14 @@ if [ ! -f "$file" ]; then log_msg "Input log file $file does not exist" - break + sleep 1 + # Test again since the 'log_msg' may create the file after being rotated + if [ -f "$file" ]; then + log_msg "Input log file $file now exists, continuing..." + else + log_msg "Input log file $file does not exist, exiting..." + break + fi fi if [ "$filetime" != "$(date -r "$file" "+%s")" -o "$argstime" != "$(date -r "$ARGSFILE" "+%s")" ]; then This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |