[arch-general] Starting 9/15 new error - stat of /var/log/clamav/clamd.log failed
Archdevs, Is this a new bug or config issue? Beginning 9/15, I receive a new cron error: error: stat of /var/log/clamav/clamd.log failed: No such file or directory But the file is there: $ l /var/log/clamav/clamd.log -rw-r--r-- 1 clamav clamav 0 Aug 30 2015 /var/log/clamav/clamd.log The wiki https://wiki.archlinux.org/index.php/ClamAV doesn't mention the issue, so is this a bug? If so, upstream or here? -- David C. Rankin, J.D.,P.E.
On Fri, Sep 21, 2018 at 7:37 AM David C. Rankin <drankinatty@suddenlinkmail.com> wrote:
Archdevs,
Is this a new bug or config issue? Beginning 9/15, I receive a new cron error:
error: stat of /var/log/clamav/clamd.log failed: No such file or directory
But the file is there:
$ l /var/log/clamav/clamd.log -rw-r--r-- 1 clamav clamav 0 Aug 30 2015 /var/log/clamav/clamd.log
Could be a permissions issue. If a user cannot access /example/ then it cannot see if /example/test exists and will give a no such file or directory error.
On 09/21/2018 02:17 AM, Andy Pieters wrote:
But the file is there:
$ l /var/log/clamav/clamd.log -rw-r--r-- 1 clamav clamav 0 Aug 30 2015 /var/log/clamav/clamd.log
Could be a permissions issue. If a user cannot access /example/ then it cannot see if /example/test exists and will give a no such file or directory error.
Well, that what I was investigating, but the log is world readable, so that can't be the case -- and the only permissions needed to stat a file is read permission. Also suspect is the log file is empty and 3 years old, so I'm not sure what is going on with it, but I do know I never got an error about it until 9/15. -- David C. Rankin, J.D.,P.E.
Hi David,
-rw-r--r-- 1 clamav clamav 0 Aug 30 2015 /var/log/clamav/clamd.log ... and the only permissions needed to stat a file is read permission.
The permissions of clamd.log are ignored when stat(2)ing it. One can stat a `chmod 0' file. What matters is execute permission on the four directories leading to it. Also, don't trust the error message if it seems incorrect. Track down the cron job and edit it to use strace(1) to learn what system calls fail and how. -- Cheers, Ralph. https://plus.google.com/+RalphCorderoy
On Fri, Sep 21, 2018 at 16:48:14 -0500, David C. Rankin wrote:
On 09/21/2018 02:17 AM, Andy Pieters wrote:
But the file is there:
$ l /var/log/clamav/clamd.log -rw-r--r-- 1 clamav clamav 0 Aug 30 2015 /var/log/clamav/clamd.log
Could be a permissions issue. If a user cannot access /example/ then it cannot see if /example/test exists and will give a no such file or directory error.
Well, that what I was investigating, but the log is world readable, so that can't be the case -- and the only permissions needed to stat a file is read permission.
So *all* the parent directories (/var, /var/log, and /var/log/clamav) are world-readable? The permissions on /var/log/clamav/clamd.log don't really matter - it could have permissions 0000 ({read,writ,execut}able by nobody), and one could still stat it correctly. Best, --Tinu
On 9/21/18 1:37 AM, David C. Rankin wrote:
Archdevs,
Is this a new bug or config issue? Beginning 9/15, I receive a new cron error:
error: stat of /var/log/clamav/clamd.log failed: No such file or directory
But the file is there:
$ l /var/log/clamav/clamd.log -rw-r--r-- 1 clamav clamav 0 Aug 30 2015 /var/log/clamav/clamd.log
The wiki https://wiki.archlinux.org/index.php/ClamAV doesn't mention the issue, so is this a bug? If so, upstream or here?
I have to think this is something you're triggering yourself. ClamAV doesn't seem to ship with any cron jobs. (See "pacman -Ql clamav | grep cron") So this must be either a cron job you've added yourself, or some old one that's left hanging around. As far as the clamd log file, I think it's normal to be empty if you're not running clam as a daemon. That's how mine is: $ ls -l /var/log/clamav/clamd.log -rw-r--r-- 1 clamav clamav 0 May 5 2013 /var/log/clamav/clamd.log Only other remaining explanations I could offer are: * The drive that /var/log/clamav is on is damaged and unreadable. (See if you see any errors in either dmesg or /var/log/messages) * You have a permissions issue on either /var/log/clamav, /var/log, or /var, whereby the user running the cronjob doesn't have read or execute permissions to one of those directories. HTH, DR
participants (5)
-
Andy Pieters
-
David C. Rankin
-
David Rosenstrauch
-
Ralph Corderoy
-
Tinu Weber