Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DescriptionPushpendra Chavan
2013-09-10 09:17:25 UTC
Description of problem:
The version of 'tail' that ships with RHEL6.4 appears to be mishandling dead symlinks.
Version-Release number of selected component (if applicable):
coreutils-8.4-19.el6.x86_64
How reproducible:
Always
Steps to Reproduce:
Please follow these precise steps in order to reproduce the errant behavior. I've prefixed each command with T1 or T2, to indicate whether that command should be run in the first terminal (T1) or the second (T2). The commands should be run in this precise order.
T1: touch logfile
T1: ln -s logfile logfile-link
T2: tail -F logfile-link
T1: echo "line 1" >> logfile
T2: observe "line 1" from tail
T1: rm logfile
T2: observe "tail: `logfile-link' has become inaccessible: No such file or directory"
T1: echo "line 2" >> logfile
T2: observe that tail is no longer tracking the contents of 'logfile'
Here is the terminal demonstration.
~~~~~~~~~~~~~~~~~~~~~
On Red Hat Enterprise Linux 5:
~~~~~~~~~~~~~~~~~~~~~
Terminal#1:
[root@dhcp223-183 ~]# mkdir /tmp/test
[root@dhcp223-183 ~]# cd /tmp/test
[root@dhcp223-183 test]# touch logfile
[root@dhcp223-183 test]#
[root@dhcp223-183 test]# ln -s logfile logfile-link
[root@dhcp223-183 test]# echo "line 1" >> logfile
[root@dhcp223-183 test]# rm -rf logfile
[root@dhcp223-183 test]# echo "line 2" >> logfile
Terminal#2:
[root@dhcp223-183 ~]# cd /tmp/test/
[root@dhcp223-183 test]# tail -F logfile-link
line 1
tail: `logfile-link' has become inaccessible: No such file or directory
line 2
It started appending the new lines.
~~~~~~~~~~~~~~~~~~~~~
Whereas on Red Hat Enterprise Linux 6:
~~~~~~~~~~~~~~~~~~~~~
Terminal#1:
[root@dhcp223-116 ~]# mkdir /tmp/test
[root@dhcp223-116 ~]# cd /tmp/test
[root@dhcp223-116 test]# touch logfile
[root@dhcp223-116 test]# ln -s logfile logfile-link
[root@dhcp223-116 test]# echo "line 1" >> logfile
[root@dhcp223-116 test]# rm logfile
rm: remove regular file `logfile'? y
[root@dhcp223-116 test]# echo "line 2" >> logfile
[root@dhcp223-116 test]# ls
logfile logfile-link
[root@dhcp223-116 test]# echo "line 2" >> logfile
[root@dhcp223-116 test]# ll
total 4
-rw-r--r-- 1 root root 14 Sep 6 10:53 logfile
lrwxrwxrwx 1 root root 7 Sep 6 10:47 logfile-link -> logfile
Terminal#2:
[root@dhcp223-116 ~]# cd /tmp/test
[root@dhcp223-116 test]# tail -F logfile-link
line 1
tail: `logfile-link' has become inaccessible: No such file or directory
^C
Here the new incoming text was not appended in tail -F output on terminal 2.
Actual results:
Tail should notice when it's monitoring a dead symlink, and "wake up" when the symlink is no longer dead, and monitor the referent's content.
Expected results:
Its not monitoring it.
Additional info:
This works on Red Hat Enterprise Linux 5 as expected.
(In reply to Pushpendra Chavan from comment #0)
> Actual results:
> Tail should notice when it's monitoring a dead symlink, and "wake up" when
> the symlink is no longer dead, and monitor the referent's content.
>
> Expected results:
> Its not monitoring it.
The expected and actual results are backwards. The actual result (in RHEL6) is that tail -F ignores updates to the referent of a symlink after the symlink is killed (the referent is removed). The expected results are like in RHEL5: tail notices when the dead symlink is revived and resumes tailing the contents of the referent.
The difference is that RHEL-6 is using inotify and RHEL-5 is using polling. You can kind of restore the RHEL-5 behaviour with using ---disable-inotify (intentionally undocumented option, as polling mode is considered deprecated). Still probably worth to fix in tail.
Issue still occurs even with coreutils-8.21.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
http://rhn.redhat.com/errata/RHSA-2013-1652.html