Bug 1343280 - crond does not load new crontab if changed twice in the first second of every minute
Summary: crond does not load new crontab if changed twice in the first second of every...
Alias: None
Product: Fedora
Classification: Fedora
Component: cronie
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Tomas Mraz
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2016-06-07 02:21 UTC by Curu Wong
Modified: 2016-06-30 14:50 UTC (History)
2 users (show)

Fixed In Version: cronie-1.5.1-1.fc25
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2016-06-30 14:50:03 UTC
Type: Bug

Attachments (Terms of Use)

Description Curu Wong 2016-06-07 02:21:52 UTC
Description of problem:
when load crontab into the in-memory database of crond, the process_crontab function in database.c will check if the mtime of a crontab is changed. if the mtime is not changed, it will skip load of the crontab file even when it was actually changed.
this will cause changes not take effect before a restart of crond.

Version-Release number of selected component (if applicable):

How reproducible:
hard to reproduce, but possible.

Steps to Reproduce:
1.make change to user crontab, say at 10:00:30 AM
2.crond will load change of step 1 at the first second of the next minute, say: 10:01:01 AM
3.make change to user crontab again, at the same second, but just several millisecond after step 2, say: 10:01:01 AM 500ms. 

Actual results:
new cron entries added in step 3 will not run by crond

Expected results:
changes in step 3 should take effect

Additional info:

Comment 1 Tomas Mraz 2016-06-30 14:50:03 UTC
This is now fixed in the newest upstream release. If a crontab is modified in the same second it is being read by crond, the crond will re-read it on the next wake-up.

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