Koozali.org: home of the SME Server

Anacron job 'cron.daily' reports stat failure

Offline Mophilly

  • *
  • 384
  • +0/-0
    • Mophilly
Anacron job 'cron.daily' reports stat failure
« on: September 14, 2017, 03:51:42 PM »
I installed and configured auto learning for email spam on an SME 9 system yesterday, September 13, 2017. It appears to have processed the files in LearnAsSpam, etc., as the files were moved to "junk".

This morning I got the following notice in email.

Code: [Select]
/etc/cron.daily/logrotate:

error: stat of /var/log/cron failed: No such file or directory
error: stat of /var/log/maillog failed: No such file or directory
error: stat of /var/log/messages failed: No such file or directory
error: stat of /var/log/secure failed: No such file or directory
error: stat of /var/log/spooler failed: No such file or directory

Checking the directory /var/log/, I see each symlink for each file named in the alert, e.g.
Code: [Select]
lrwxrwxrwx  1 root    root         28 Sep 13 07:43 cron -> /var/log/cron.20170913074342

All symlinks belong to root:root and have the same file permissions.

What is the import of this message and resolution for this condition?
- Mark

Offline Mophilly

  • *
  • 384
  • +0/-0
    • Mophilly
Re: Anacron job 'cron.daily' reports stat failure
« Reply #1 on: November 26, 2017, 07:30:44 PM »
More to this issue. I don't recall resolving the issue in the OP. However, I hadn't notice the alert emal in recent weeks. Yesterday the alert email began coming daily again.

Each symlink mentioned in the error email is reported as broken (name in red, flashing).

Code: [Select]
lrwxrwxrwx  1 root    admin        32 Nov 23 08:13 messages -> /var/log/messages.20171123081310
lrwxrwxrwx  1 root    root         32 Oct 29 01:12 messages-20171029 -> /var/log/messages.20171029011202
lrwxrwxrwx  1 root    root         32 Nov  1 01:12 messages-20171105 -> /var/log/messages.20171101011202
lrwxrwxrwx  1 root    root         32 Nov 11 10:00 messages-20171112 -> /var/log/messages.20171111100009
lrwxrwxrwx  1 root    root         32 Nov 15 01:12 messages-20171119 -> /var/log/messages.20171115011202

Note the links do not point to real file names, e.g. "/var/log/messages.20171029011202" does not exist.

Is this merely log noise, perhaps resolved by adding "missingok" to the crontab or similar as suggested in old posts about redhat.

I notice the current file, e.g. "messages", has "admin" as the group. Should that be "root"? (does this matter?)

Bug report 8874 in bugzilla seems to relate to this issue.

Comments are welcome.
- Mark

Offline Jean-Philippe Pialasse

  • *
  • 2,763
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Anacron job 'cron.daily' reports stat failure
« Reply #2 on: November 27, 2017, 03:31:58 AM »
This could be related to issuing a signal-event post-upgrade without reboot or other situation where logrotate occurs and syslog is not restarted.