Bug 296741 - anacron + crontabs 1.10-17.fc8: run-parts doesn't execute all cronjobs
Summary: anacron + crontabs 1.10-17.fc8: run-parts doesn't execute all cronjobs
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: crontabs
Version: rawhide
Hardware: All
OS: Linux
low
high
Target Milestone: ---
Assignee: Marcela Mašláňová
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 303031 (view as bug list)
Depends On:
Blocks: F8Blocker F8Test3
TreeView+ depends on / blocked
 
Reported: 2007-09-19 18:11 UTC by Robert Scheck
Modified: 2007-11-30 22:12 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-09-25 08:56:11 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Robert Scheck 2007-09-19 18:11:43 UTC
Description of problem:
Latest vixie-cron in devel looks *very broken* to me:

Sep 19 19:50:01 tux CROND[32056]: (vnstat) CMD (/usr/sbin/vnstat.cron)
Sep 19 19:50:01 tux CROND[32056]: (vnstat) CMD (/usr/sbin/vnstat.cron)
Sep 19 19:50:01 tux CROND[32056]: (vnstat) CMD (/usr/sbin/vnstat.cron)
Sep 19 20:01:01 tux CROND[768]: (root) CMD (run-parts /etc/cron.hourly)
Sep 19 20:05:01 tux CROND[1326]: (vnstat) CMD (/usr/sbin/vnstat.cron)
Sep 19 20:05:01 tux CROND[1326]: (vnstat) CMD (/usr/sbin/vnstat.cron)
Sep 19 20:05:01 tux CROND[1326]: (vnstat) CMD (/usr/sbin/vnstat.cron)

Why the hell is this executed *three* times in the same second? It's just an 
every 5 minutes cronjob (*/5). So only once per 5 minutes would be enough. 
Unfortunately the cronjob is NOT executed at 20:00:00 - why? Please fix this 
broken things as soon as possible.

It also looks like my logwatch is no longer executed. Logwatch is installed 
correctly and "rpm -V logwatch" returns also nothing. As this worked with 
older versions, something else in vixie-cron must be broken, too.

Version-Release number of selected component (if applicable):
vixie-cron-4.2-2

How reproducible:
Install vixie-cron and vnstat from devel and get some popcorn or cookies when 
watching to /var/log/cron... ;-)

Actual results:
Heavily broken vixie-cron.

Expected results:
Working vixie-cron like in the past (before 4.1-84 or so)

Comment 1 Robert Scheck 2007-09-20 22:14:47 UTC
Looks like cron.hourly, cron.daily, cron.monthly etc. don't work, means that 
they are not executed simply. And the logging behaviour IMHO broke with rsyslog.

Comment 2 Will Woods 2007-09-21 14:46:32 UTC
No, in my testing cron.{hourly,daily,monthly} do get run - sometimes. I have
this in cron.hourly:

#!/bin/sh
touch /tmp/cron-ok
/usr/bin/logger -t crondtest "cron.hourly running OK"
exit 0

I have a /tmp/cron-ok file - but it hasn't been touched in 11 hours (since 23:00
last night). 

The logs are equally strange - I get the log message five times, at 19:00, and
not before or since. 

Further, I installed vnstat, and vnstat runs only at 5 past the hour (instead of
every 5 minutes). However, it *does* run 12 times per hour - just 12 times at once!

Comment 3 Will Woods 2007-09-21 20:19:59 UTC
Okay - figured out why cron.hourly isn't working right. run-parts now has this
at the top:

# if cron.daily was run today
AUX1=`cat /var/spool/anacron/cron.daily`
AUX2=`date +%Y%m%d`
[ "$AUX1" == $AUX2 ] || exit 0

Which means that run-parts silently fails - for *all* cases (hourly, weekly,
etc) - if anacron has run cron.daily today. 

I completely fail to understand why this code is here. It's anacron's job to
figure out if cron.daily has been run already today, not run-parts. Why is that
there?

Removing those four lines should fix cron.hourly, at least.

Comment 4 Will Woods 2007-09-21 21:34:17 UTC
As for the log messages - the vnstat cron is definitely being *run* every 5
minutes, but the log messages have the wrong time and pid on them. That may
actually be just an rsyslog bug. I'll try to investigate further - maybe testing
with a different syslogd would help?

Comment 5 Robert Scheck 2007-09-21 22:46:10 UTC
The run-parts thing was introduced between crontabs-1.10-14 and -16.

Comment 6 Marcela Mašláňová 2007-09-24 10:43:55 UTC
My vnstat is running every five minutes. I'm working on fix of cron.hourly.

Comment 7 Robert Scheck 2007-09-24 10:52:11 UTC
Yes, vnstat is running every five minutes, but logging is broken. As far as I 
can see, it's not only cron.hourly.

Comment 8 Marcela Mašláňová 2007-09-24 13:04:15 UTC
rsyslog has some logging problems. If you run rsyslog with -e it's ok or you can
try syslog-ng instead of rsyslog.


Comment 9 Will Woods 2007-09-24 15:23:00 UTC
*** Bug 303031 has been marked as a duplicate of this bug. ***

Comment 10 Will Woods 2007-09-24 15:31:25 UTC
Bug 303031 was correctly filed against crontabs - changing component here.

I've created a different bug to track the rsyslogd timestamp problem: bug 303341

Comment 11 Marcela Mašláňová 2007-09-25 08:56:11 UTC
Fix in crontabs-1.10-18.fc8 and anacron-2.3-56.fc8. Cron.{hourly,daily,...} run
correct.


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