From c0dd3d4d8e033b2819776a23e8fc1549ded7899b Mon Sep 17 00:00:00 2001 From: Darren 'Tadgy' Austin Date: Sun, 13 May 2018 20:56:12 +0100 Subject: [PATCH] Don't process empty log lines - fixes a bug that manifests itself with proftpd wherein every log line is followed by an empty one. --- lumberjack | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lumberjack b/lumberjack index 6f5f112..da9ed3c 100755 --- a/lumberjack +++ b/lumberjack @@ -369,6 +369,9 @@ while :; do # If the 'read' timed out and the exapnded template is the same as the old expanded template, there is no need to do anything. (( LJ_TIMED_OUT == 1 )) && [[ "$LJ_EXPANDED_TEMPLATE" == "$LJ_OLD_TEMPLATE" ]] && continue + # If the 'read' did not time out but the line read is empty, don't do anything. + (( LJ_TIMED_OUT != 1 )) && [[ "$LJ_LOG_DATA" =~ ^[[:space:]]*$ ]] && continue + # Make sure the base directory still exists - it could have disappeared while we were blocked in 'read'. # Note: We won't make this directory ourselves - as it's the base directory it should exist on the system to start with. [[ ! -e "$LJ_BASEDIR" ]] && {