Bug 507598 - hourly mail to root: "/var/spool/anacron/cron.daily: No such file or directory"
hourly mail to root: "/var/spool/anacron/cron.daily: No such file or directory"
Product: Fedora
Classification: Fedora
Component: anacron (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Marcela Mašláňová
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2009-06-23 08:38 EDT by Dennis Jacobfeuerborn
Modified: 2009-07-09 07:34 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-07-09 07:34:01 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Dennis Jacobfeuerborn 2009-06-23 08:38:11 EDT
Every hour root gets a mail with the following message:


cat: /var/spool/anacron/cron.daily: No such file or directory

Yet when I try to look at that file it apparently exists:

[root@nexus ~]# cat /var/spool/anacron/cron.daily 

Is this some kind of race condition where the file gets deleted/re-created when this cron-job runs? Looking at /etc/anacrontab I can see that anacron is used to run the daily cron-jobs so removing it from the system or disabling is not an option but the constant "You have mail in /var/spool/mail/root" messages I get are somewhat annoying.
Comment 1 Marcela Mašláňová 2009-06-23 09:08:42 EDT
I saw it only once after installation. I'll fix the problem but you have something different. Do you have cronie, crontabs and anacron installed and which versions?
Comment 2 Dennis Jacobfeuerborn 2009-06-23 11:22:16 EDT
[dennis@nexus tripod]$ rpm -q cronie crontabs anacron

This is a fresh F11 install with all updates applied except for 8 pulseaudio packages because audio works with the versions from fedora release but not the ones from the latest updates.
Comment 3 Marcela Mašláňová 2009-06-30 09:08:21 EDT
In case the file /var/spool/anacron/cron.daily exists, it shouldn't be sending emails. At least I can't reproduce this behaviour. The problem of non-existent file should be solved by rewrite of script. 

cat /etc/cron.hourly/0anacron
#in case file doesn't exist
if test -x /var/spool/anacron/cron.daily; then
    day=`cat /var/spool/anacron/cron.daily`
if [ `date +%Y%m%d` = "$day" ]; then
    exit 0;

# in case anacron is already running,
# there will be log (daemon won't be running twice).
if test -x /usr/bin/on_ac_power; then
    /usr/bin/on_ac_power &> /dev/null
    if test $? -eq 1; then
    exit 0
/usr/sbin/anacron -s

And this should be working for you.

Note You need to log in before you can comment on or make changes to this bug.