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.
Description of problem:
This problem part of a patch that has been applied in the RHEL 6.5 release set.
There is some information about the problem here https://access.redhat.com/site/solutions/634593 however I have no access to this document.
The spec file indicates that this is part of bugzilla bug 10006221 (possibly 1006221) but I have no access to this bug either.
Finally the changelog states that in release 8.4-27
"tail -F now disables inotify when encountering a symlink. Polling is used instead."
I understand the need for this patch, as a means to detect renames and unlinks of the watch file and that inotify currently is unable to do this properly when the file being watched is a symlink however, the patch is incorrectly written and generates too much scope.
In the RPM sources, the patch labelled "coreutils-8.4-tail-symlink-polling.patch" achieves this purpose using the following logic:
if (!lstat(F[i].name, &st) && S_ISLNK(st.st_mode))
However, this is not what I believe ooprala had in mind, as this will apply to any symlink, regardless of follow mode.
This has the effect of producing a warning using a simple tail command to print out any file that is a symlink, irrespective of if you intend to follow it or not.
Please alter the patch so that it uses this logic instead:
if (!lstat(F[i].name, &st) && S_ISLNK(st.st_mode) && follow_mode == Follow_name)
This ensure that we only produce the warning if we pass tail -F (since tail -f is the implicit default) and prevents warnings being printed when our intention is to merely tail without following.
We also avoid disabling inotify where we actually are interested in following the file descriptor itself where it would be more beneficial and efficient to do so.
Version-Release number of selected component (if applicable):
8.4-27 ? and above.
How reproducible:
100%
Steps to Reproduce:
1. Create a symlink.
2. Run "tail path-to-symlink"
Actual results:
Tail prints to stderr a warning about not using inotify and to stdout the typical tail output.
Expected results:
Just the typical tail output.
If we want to name follow then print the warning if the user passes tail -F path-to-symlink.
Additional Info:
I did not supply a patch as it would end up ultimately being a patch to a patch, which just didn't feel appropriate to me.
Thanks for report, we are already aware of it, slightly different approach will be used to fix it in next coreutils update. I'll mark this as a duplicate of original report.
*** This bug has been marked as a duplicate of bug 1046818 ***