Bug 1343280

Summary: crond does not load new crontab if changed twice in the first second of every minute
Product: [Fedora] Fedora Reporter: Curu Wong <prinbra>
Component: cronieAssignee: Tomas Mraz <tmraz>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: mmaslano, tmraz
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: cronie-1.5.1-1.fc25 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-30 14:50:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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):
cronie-1.4.4

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.