Bug 510117 - crond running run-parts twice
Summary: crond running run-parts twice
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: cronie
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Marcela Mašláňová
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-07-07 18:36 UTC by Valdis Kletnieks
Modified: 2009-07-09 11:44 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-07-08 07:30:47 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Valdis Kletnieks 2009-07-07 18:36:46 UTC
Description of problem:
Although I have only one entry for 'cron.hourly' in /etc/crontab, it's running it twice for some reason:

% cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
00 0 * * * root run-parts /etc/cron.midnight
02 2 * * * root ionice -c3 run-parts /etc/cron.daily
42 3 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
% cat /var/log/cron
Jul  7 10:24:54 turing-police crond[2728]: (CRON) STARTUP (1.3)
Jul  7 10:24:54 turing-police crond[2728]: (CRON) INFO (running with inotify support)
Jul  7 11:01:01 turing-police CROND[14343]: (root) CMD (run-parts /etc/cron.hourly)
Jul  7 11:01:01 turing-police CROND[14344]: (root) CMD (run-parts /etc/cron.hourly)
Jul  7 11:01:01 turing-police run-parts(/etc/cron.hourly)[14343]: starting 0anacron
Jul  7 11:01:01 turing-police run-parts(/etc/cron.hourly)[14344]: starting 0anacron
Jul  7 11:01:01 turing-police run-parts(/etc/cron.hourly)[14360]: finished 0anacron
Jul  7 11:01:01 turing-police run-parts(/etc/cron.hourly)[14362]: finished 0anacron
Jul  7 11:01:01 turing-police run-parts(/etc/cron.hourly)[14343]: starting mcelog.cron
Jul  7 11:01:01 turing-police run-parts(/etc/cron.hourly)[14344]: starting mcelog.cron
Jul  7 11:01:02 turing-police run-parts(/etc/cron.hourly)[14377]: finished mcelog.cron
Jul  7 11:01:02 turing-police run-parts(/etc/cron.hourly)[14378]: finished mcelog.cron
Jul  7 12:01:01 turing-police CROND[18279]: (root) CMD (run-parts /etc/cron.hourly)
Jul  7 12:01:01 turing-police CROND[18278]: (root) CMD (run-parts /etc/cron.hourly)
Jul  7 12:01:01 turing-police run-parts(/etc/cron.hourly)[18278]: starting 0anacron
Jul  7 12:01:01 turing-police run-parts(/etc/cron.hourly)[18279]: starting 0anacron
Jul  7 12:01:01 turing-police run-parts(/etc/cron.hourly)[18299]: finished 0anacron
Jul  7 12:01:01 turing-police run-parts(/etc/cron.hourly)[18301]: finished 0anacron
Jul  7 12:01:01 turing-police run-parts(/etc/cron.hourly)[18279]: starting mcelog.cron
Jul  7 12:01:01 turing-police run-parts(/etc/cron.hourly)[18278]: starting mcelog.cron
Jul  7 12:01:01 turing-police run-parts(/etc/cron.hourly)[18316]: finished mcelog.cron
Jul  7 12:01:01 turing-police run-parts(/etc/cron.hourly)[18317]: finished mcelog.cron
% ps ax|grep 'cr[o]n'
  2728 ?        Ss     0:00 crond

One cron running, one entry in /etc/crontab, but it's getting run twice.  And it's not just a double-logging issue (note the different PIDs), I'm seeing e-mail from both mcelog.cron runs, 2 per hour.

Oddly enough, this *only* seems to affect the cron.hourly - the other run-parts calls in crontab are only run once.  Perhaps a "first entry in crontab" bug?

Not sure how long it's been doing this - I only noticed it because Bug #507026 was causing mcelog.cron to generate e-mail outputs, and my cron logs only go back to June 1.

Version-Release number of selected component (if applicable):
cronie-1.3-2.fc12.x86_64

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Marcela Mašláňová 2009-07-08 07:30:47 UTC
Since F-11 are hourly executed from /etc/cron.d/0hourly and /etc/crontab is empty in default installation. 

So you need remove /etc/cron.d/0hourly job or your line:
"01 * * * * root run-parts /etc/cron.hourly"

Anyway I should document it in man pages.

Comment 2 Valdis Kletnieks 2009-07-08 17:06:59 UTC
Damn.  I must have missed that change in the release notes.

Comment 3 Marcela Mašláňová 2009-07-09 11:44:36 UTC
Damn, I didn't document enough. I'm still working so hopefully the next release will be fully documented and with release notes.


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