You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found this is an expected behavior.
See 00DIST file. I found following entry in 4.88:
Fixed field output to insure that the field descriptor field is
always selected, since it identifies the file set. The bug was
reported by Gary Plewa <[email protected]>.
I'm not sure how that makes sense. I specifically asked lsof to only print the pid, but lsof decided I wanted to also see the file descriptors? Why are we overriding the admin's choice here? If I wanted both, I should use "lsof -Ffp".
I get the same question. However, as far as reading the man page of lsof, the behavior is intentional.
The behavior is documented. There may be users who wrote scripts depending on this behavior.
Therefore I'm in negative for changing the behavior again.
Everyone currently running RHEL/CentOS 6 or 7 rely on the old behavior. Once those distros reach EOL and users migrate to RHEL/CentOS 8, their scripts will break (as did ours). The current behavior is nonsensical. I ask for a pid, and I get more than I asked for. What's the point of the -F flag if it is ignored? Do we need to add a new -F option such as "O" which stands for "the pid, and Only the pid"?
I sent a mail to Gary Plewa to know the original bug report.
The bug was reported in 6 or 7 year ago. So I will wait for a response for (at least) two weeks.
Please, wait for awhile.
Everyone currently running RHEL/CentOS 6 or 7 rely on the old behavior. Once those distros reach EOL and users migrate to RHEL/CentOS 8, their scripts will break (as did ours). The current behavior is nonsensical. I ask for a pid, and I get more than I asked for. What's the point of the -F flag if it is ignored? Do we need to add a new -F option such as "O" which stands for "the pid, and Only the pid"?
I agree with enabling 'fd (f)' by default is non-sense.
How about 'pid (p)' and 'mark (m)'? Even on RHEL7, they are enabled by default.
The fact that "lsof -F f" also prints the pid makes some sense when it is not pid restricted (with -p X). Otherwise you'd just get a list of a bunch of file descriptors and have no idea what pid they were associated with. One could argue that "lsof -p X -F f" should not print the pid since we already provided it, but given that the output of that command already prints multiple lines, current consumers will already know they need to filter out the pid #.
The way lsof used to work (in my original example) is that it would always only print one line of output, and not require further filtering. Now it requires | grep ^p.
Activity
masatake commentedon Aug 24, 2020
Could you tell me the version of the "earlier version"?
po5857 commentedon Aug 25, 2020
4.87
masatake commentedon Aug 25, 2020
Thank you.
masatake commentedon Aug 25, 2020
I found this is an expected behavior.
See 00DIST file. I found following entry in 4.88:
po5857 commentedon Aug 25, 2020
I'm not sure how that makes sense. I specifically asked lsof to only print the pid, but lsof decided I wanted to also see the file descriptors? Why are we overriding the admin's choice here? If I wanted both, I should use "lsof -Ffp".
masatake commentedon Aug 25, 2020
I get the same question. However, as far as reading the man page of lsof, the behavior is intentional.
The behavior is documented. There may be users who wrote scripts depending on this behavior.
Therefore I'm in negative for changing the behavior again.
po5857 commentedon Aug 26, 2020
Everyone currently running RHEL/CentOS 6 or 7 rely on the old behavior. Once those distros reach EOL and users migrate to RHEL/CentOS 8, their scripts will break (as did ours). The current behavior is nonsensical. I ask for a pid, and I get more than I asked for. What's the point of the -F flag if it is ignored? Do we need to add a new -F option such as "O" which stands for "the pid, and Only the pid"?
masatake commentedon Aug 27, 2020
I sent a mail to Gary Plewa to know the original bug report.
The bug was reported in 6 or 7 year ago. So I will wait for a response for (at least) two weeks.
Please, wait for awhile.
masatake commentedon Sep 15, 2020
I have not received a reply yet. So I will apply my change: #103 (comment) .
masatake commentedon Sep 22, 2020
I agree with enabling 'fd (f)' by default is non-sense.
How about 'pid (p)' and 'mark (m)'? Even on RHEL7, they are enabled by default.
Though I specified only 'f', lsof also prints 'p'.
Disabling 'p' by default is easy. However, it breaks the scripts will break.
About 'm', I think enabling by default is acceptable.
@po5857, do you have any comments?
po5857 commentedon Sep 23, 2020
The fact that "lsof -F f" also prints the pid makes some sense when it is not pid restricted (with -p X). Otherwise you'd just get a list of a bunch of file descriptors and have no idea what pid they were associated with. One could argue that "lsof -p X -F f" should not print the pid since we already provided it, but given that the output of that command already prints multiple lines, current consumers will already know they need to filter out the pid #.
The way lsof used to work (in my original example) is that it would always only print one line of output, and not require further filtering. Now it requires | grep ^p.
Don't select the file descriptor field by default.
masatake commentedon Oct 23, 2020
@po5857, can I ask you to review the change for the man page in #125?
po5857 commentedon Oct 24, 2020
This change:
Is a bit deceptive, since the marker field is only output when in repeat mode. Perhaps this would be more accurate:
always prints one field, the PID (`p') field. In repeat mode, the marker is also printed.
Similar here:
should perhaps be:
masatake commentedon Oct 24, 2020
Thank you very much. I will reflect your comment in my change soon and merge it.
Don't select the file descriptor field by default.
Don't select the file descriptor field by default.
masatake commentedon Oct 24, 2020
Merge the change. Thank you.
Give access to the CA certificates from the host
Give access to the CA certificates from the host