Bug 221856 - Cron does not detect changed symlink
Summary: Cron does not detect changed symlink
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: vixie-cron
Version: 4.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Marcela Mašláňová
QA Contact: Brock Organ
URL:
Whiteboard:
: 225078 (view as bug list)
Depends On:
Blocks: 225078 253391
TreeView+ depends on / blocked
 
Reported: 2007-01-08 16:10 UTC by Jose Plans
Modified: 2007-11-17 01:14 UTC (History)
1 user (show)

Fixed In Version: RHBA-2007-0685
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-08-02 08:06:11 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2007:0685 0 normal SHIPPED_LIVE vixie-cron bug fix and enhancement update 2007-11-15 17:34:46 UTC

Description Jose Plans 2007-01-08 16:10:22 UTC
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.

     Jose

Comment 1 Jose Plans 2007-01-08 16:10:23 UTC
Created attachment 145065 [details]
Patch fixing the problem.

Comment 3 Marcela Mašláňová 2007-01-12 17:22:00 UTC
Hello Jose,
I appreciate your patch. Thank you. 

I'll update Fedora later with some other patches. For RHEL5 I opened bugzilla
#222461.

Comment 9 Marcela Mašláňová 2007-07-10 16:32:30 UTC
*** Bug 225078 has been marked as a duplicate of this bug. ***

Comment 13 Red Hat Bugzilla 2007-08-02 08:06:12 UTC
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.

http://rhn.redhat.com/errata/RHBA-2007-0685.html



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