Red Hat Bugzilla – Bug 221856
Cron does not detect changed symlink
Last modified: 2007-11-16 20:14:55 EST
Ok so summary and explanations.
a) create two crontab files in /tmp
/tmp/cron_a : * * * * * root /bin/date
/tmp/cron_b : * * * * * root /bin/ls /tmp
b) symlink cron_a to an intermediate symlink
% ln -s /tmp/cron_a /tmp/cron_symlink
c) symlink this intermediate one to the cron.d directory
% ln -s /tmp/cron_symlink /etc/cron.d/test
d) Restart crond.
e) Everything works as expected.
f) Delete the intermediate symlink so we can add the other cron_b instead.
% rm /tmp/cron_symlink
g) symlink cron_b now to the intermediate
% ln -s /tmp/cron_b /tmp/cron_symlink
h) *DO NOT* restart just reload, nothing happens.
Ok vixie-cron is not well aware of symlinks, it doesn't know if we changed or
not a symbolic link; however everything is in place to reload stuff as the
signal is monitored and there is a sa_handler updating a volatile flag.
Now, the solution to this problem would be to just reload the database when
SIGHUP is send and/or, in other words, we did service crond reload.
However, since the database is only checked when the modified time changed on
the directory /etc/cron.d, we miss the tick.. The solution then is to reset
m_time so we are sure this happens on SIGHUP.
This happens with all vixie-cron 4.1-xxx
Marcela, this also goes on FedoraCore and RHEL5, let me know if you want me to
clone the bug or you need anything else.
Also the patch has been tested succesful.
Created attachment 145065 [details]
Patch fixing the problem.
I appreciate your patch. Thank you.
I'll update Fedora later with some other patches. For RHEL5 I opened bugzilla
*** Bug 225078 has been marked as a duplicate of this bug. ***
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.