#755158 After dist-upgrade logcheck cannot open logoutput

Package:
logcheck
Source:
logcheck
Submitter:
Jaap van Wingerde
Date:
2023-03-14 18:21:03 UTC
Severity:
important
Tags:
#755158#5
Date:
2014-07-18 11:36:29 UTC
From:
To:
After distribution upgrade from Squeeze to Wheezy logcheck sends the following e-mails:

"Subject: Cron <logcheck@gaugino>    if [ -x /usr/sbin/logcheck ]; then nice -n10 /usr/sbin/logcheck; fi
Date: Fri, 18 Jul 2014 11:02:02 +0000 (UTC)

sort: open failed: /tmp/logcheck.hD3dDo/logoutput/*: No such file or directory"

#755158#10
Date:
2017-03-02 12:19:18 UTC
From:
To:
This is a problem that can present itself and generate cron emails not
only if the permissions are wrong, but also if the file
/etc/logcheck/logcheck.logfiles does not contains any non commented line

To avoid receiving notification I have modified the following line:

- $SORT "$TMPDIR/logoutput"/* | sed -e 's/[[:space:]]\+$//' | cat  \
+ cd && find "$TMPDIR/logoutput" -type f | $SORT | sed -e
's/[[:space:]]\+$//' | cat  \

Matteo Castellani

#755158#15
Date:
2017-08-13 13:28:20 UTC
From:
To:
This is caused by something making /var/log/syslog root:root 600 on dist-upgrade on my system.
#755158#20
Date:
2023-03-12 17:43:30 UTC
From:
To:
Most of this bug no longer applies, but there is a small issue

The current code (line 783 approx) catches errors from $SORT, but if
the error comes from having zero log files to check i think it will be
a bit confusing.

currently logoutput-sorted would be created as an empty file, but the
call to error() would be a bit confusing

And (once we add a systemd unit) the stderr from sort/sed could end up
in the journal

Think before the call to $SORT logcheck should check if
$TMPDIR/logoutput/ is empty and if so, silently (or perhaps with error
as it seems unlikely to be deliberate) do an exit 0

I think perhaps worth redirecting stderr into
"$TMPDIR/logoutput-sorted" (perhaps needed elsewhere too) but i did
not consider this fully yet

one for post-bookworm