Bug 477100

Summary: CAN'T OPEN (/etc/cron.d/<some symbolic link>): Too many levels of symbolic links
Product: [Fedora] Fedora Reporter: Davide Repetto <red>
Component: cronieAssignee: Marcela Mašláňová <mmaslano>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: low    
Version: 10CC: dshaw, mmaslano, pertusus, tmraz
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: 2008-12-30 23:45:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Davide Repetto 2008-12-19 03:08:34 UTC
Description of problem:
=======================

Symbolic links in /etc/cron.d/ are not followed anymore



Version-Release number of selected component (if applicable):
=============================================================

cronie-1.2-4.fc10.i386



How reproducible:
=================

By having symlinks in /etc/cron.d/


Steps to Reproduce:
===================
1. insert a symlink in /etc/cron.d/
2. wait until its cron time
3. watch the cron log
  

Actual results:
===============

* The con job is not executed
* You find something like this in the cron log:
Dec 18 13:52:19 dns1 crond[1689]: (root) CAN'T OPEN (/etc/cron.d/radwho-clean): Too many levels of symbolic links
Dec 18 13:52:19 dns1 crond[1689]: (root) CAN'T OPEN (/etc/cron.d/listproc-watchdog): Too many levels of symbolic links
Dec 18 13:52:19 dns1 crond[1689]: (root) CAN'T OPEN (/etc/cron.d/spamshield): Too many levels of symbolic links


Expected results:
=================
Proper execution of the cron job

Additional info:
================
This breakage is very critical.
While it potentially breaks cron jobs that people is used to relay on, it may easily go unnoticed for long times and on servers it may lead to huge disasters.

Comment 1 Tomas Mraz 2008-12-19 08:26:42 UTC
The problem is that with inotify support cronie would have to watch all the symlinked files individually. So just simply removing the O_NOFOLLOW would not be enough. Otherwise if the symlinked file was changed the crond would not notice.

Comment 2 Marcela Mašláňová 2008-12-19 12:39:31 UTC
I removed O_NOFOLLOW for the meantime. At least symlinked jobs will be working, but the changes in crontab can't be watched for these files.

Comment 3 Patrice Dumas 2008-12-19 13:34:29 UTC
It seems to me to be a limitation of inotify. Not being able to watch for symlink creation and not being able to watch for changes in the file corresponding with the symlink when it is possible to do that for normal files in a directory is, in my opinion, problematic. 

I tested that using IN_MODIFY or IN_CLOSE_NOWRITE (and I guess IN_ACCESS could also do that) the directory is notified of those changes, but a ls also triggers an event.

So not watching symlinks is certainly the best thing to do for now, but I think that it should be documented, and also that it would be nice to try to contact inotify people to add this functionality.

Comment 4 Fedora Update System 2008-12-22 15:39:15 UTC
cronie-1.2-6.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/cronie-1.2-6.fc10

Comment 5 Marcela Mašláňová 2008-12-23 09:38:58 UTC
Symlinked crontabs are watched in the next version, but they need to be reloaded after change.

In my opinion inotify works well and watching symlinks should be solved in user space.

Comment 6 Fedora Update System 2008-12-24 18:43:03 UTC
cronie-1.2-7.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update cronie'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2008-11809

Comment 7 Fedora Update System 2008-12-30 23:45:55 UTC
cronie-1.2-7.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 David Shaw 2009-09-25 02:26:02 UTC
This problem seems to have reoccurred in Fedora 11 with cronie-1.3-2.fc11.i586

Comment 9 Marcela Mašláňová 2009-09-25 06:36:54 UTC
Git version didn't contain this patch. Thank for reminder. It's fixed in cronie-1.3-3.fc11.