Bug 303031

Summary: bug in /usr/bin/run-parts prevents jobs from running
Product: [Fedora] Fedora Reporter: Jonathan Kamens <jik>
Component: crontabsAssignee: Marcela Mašláňová <mmaslano>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: low    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-09-24 15:22:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jonathan Kamens 2007-09-24 13:53:54 UTC
This recently added line in /usr/bin/run-parts:

[ "$AUX1" == $AUX2 ] || exit 0

should read "&& exit 0" rather than "|| exit 0".  The incorrect code above is 
basically saying, "Don't run this script if it hasn't been run yet today," when 
what it's trying to say is, "Don't run this script if it *has* been run today."

Also, it's bad form to only quote one side of a test expression.  There's no 
harm in writing "$AUX2" instead of $AUX2, and it's better code hygiene to do so.

Finally, since there's no guaranteeing that /var/spool/anacron/cron.daily will 
exist (anacron isn't a requirement for cron, after all), the line above this 
one for setting AUX1 should have "2>/dev/null" to suppress errors if the file 
does not exist.

Basically, whatever you're trying to accomplish with this code, you haven't 
done a very good job of it in this pass.

I have crontabs-1.10-17.fc8.

Comment 1 Jonathan Kamens 2007-09-24 13:54:56 UTC
Oh, and another thing, worse than most of the other problems listed above... 
run-parts is used for cron.hourly as well as cron.daily, weekly and monthly, 
and the newly added code will prevent the hourly cron jobs from running after 
cron.daily has run.


Comment 2 Will Woods 2007-09-24 15:22:59 UTC

*** This bug has been marked as a duplicate of 296741 ***