Red Hat Bugzilla – Bug 303031
bug in /usr/bin/run-parts prevents jobs from running
Last modified: 2007-11-30 17:12:16 EST
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.
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.
*** This bug has been marked as a duplicate of 296741 ***