Bug 221856 - Cron does not detect changed symlink
Cron does not detect changed symlink
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: vixie-cron (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Marcela Mašláňová
Brock Organ
: 225078 (view as bug list)
Depends On:
Blocks: 225078 253391
  Show dependency treegraph
Reported: 2007-01-08 11:10 EST by Jose Plans
Modified: 2007-11-16 20:14 EST (History)
1 user (show)

See Also:
Fixed In Version: RHBA-2007-0685
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-08-02 04:06:11 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch fixing the problem. (1.25 KB, patch)
2007-01-08 11:10 EST, Jose Plans
no flags Details | Diff

  None (edit)
Description Jose Plans 2007-01-08 11:10:22 EST
Ok so summary and explanations.
 * Reproducer:
  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.

Comment 1 Jose Plans 2007-01-08 11:10:23 EST
Created attachment 145065 [details]
Patch fixing the problem.
Comment 3 Marcela Mašláňová 2007-01-12 12:22:00 EST
Hello Jose,
I appreciate your patch. Thank you. 

I'll update Fedora later with some other patches. For RHEL5 I opened bugzilla
Comment 9 Marcela Mašláňová 2007-07-10 12:32:30 EDT
*** Bug 225078 has been marked as a duplicate of this bug. ***
Comment 13 Red Hat Bugzilla 2007-08-02 04:06:12 EDT
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.


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