Bug 744406 - pkill/pgrep command completion uses 'command' while pkill works on 'comm'
Summary: pkill/pgrep command completion uses 'command' while pkill works on 'comm'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: bash-completion
Version: rawhide
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Ville Skyttä
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-08 12:47 UTC by Oliver Henshaw
Modified: 2014-11-15 09:09 UTC (History)
6 users (show)

Fixed In Version: bash-completion-2.1-6.20141110git52d8316.fc21
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-11-15 09:09:40 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Oliver Henshaw 2011-10-08 12:47:39 UTC
Description of problem:

pgrep/pkill bash completion completes the full name of the command but matches the pattern against 'comm', which is truncated to TASK_COMM_LEN (set to 16 on all kernels afaict). This fails for long commands. 'pgrep -f' with autocomplete does match long command names, as expected

e.g. with flash running in firefox's container:

$ psgrep plu<TAB>
$ pgrep plugin-container
$ pgrep -f plugin-container
4087
$ pgrep plugin-containe
4087


This seems to be because /etc/bash_completion.d/procps uses '_pnames' from /etc/bash_completion which uses 'command ps axo command='. There's a comment that refers to http://bugs.debian.org/497540#19 which discusses this a little without coming to any conclusion.

But the only user of _pnames on my system is procps. So surely _pnames should use comm to match the expectations of its only user? (Possibly there's another bash-completion script in the fedora repo that uses _pnames, but I haven't checked.)


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

procps-3.2.8-21.20110302git.fc15.x86_64
bash-completion-1.3-5.fc15.noarc

Comment 1 Fedora End Of Life 2012-08-07 16:26:22 UTC
This message is a notice that Fedora 15 is now at end of life. Fedora
has stopped maintaining and issuing updates for Fedora 15. It is
Fedora's policy to close all bug reports from releases that are no
longer maintained. At this time, all open bugs with a Fedora 'version'
of '15' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that
we were unable to fix it before Fedora 15 reached end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged to click on
"Clone This Bug" (top right of this page) and open it against that
version of Fedora.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

The process we are following is described here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 2 Oliver Henshaw 2012-08-08 12:36:01 UTC
No change on F17. Though now the relevant files are /usr/share/bash-completion/completions/pgrep and /usr/share/bash-completion/bash_completion.

bash-4.2.37-2.fc17.x86_64
bash-completion-2.0-1.fc17.noarch

Comment 3 Fedora End Of Life 2013-07-04 05:52:35 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Fedora End Of Life 2013-08-01 17:09:37 UTC
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 5 Fedora End Of Life 2013-12-21 14:57:27 UTC
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '18'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior to Fedora 18's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 6 Fedora End Of Life 2014-02-05 22:42:39 UTC
Fedora 18 changed to end-of-life (EOL) status on 2014-01-14. Fedora 18 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 7 Jaromír Cápík 2014-11-07 16:56:42 UTC
Hello Oliver.

Sorry, that it didn't get my attention sooner. This is still an issue, but the bash completion for procps/procps-ng tools is a part of the 'bash-completion' component. I'm changing the component.

Regards,
Jaromir.

Comment 8 Ville Skyttä 2014-11-09 09:31:31 UTC
Things have changed in bash-completion quite a bit since version 1.3, and I'm not sure I follow if this is still an issue. _pnames() is used by at least killall, pgrep, pkill, and pidof completions, and instead of "comm" it uses "command" which as I understand does not have the truncation issue.

Comment 9 Oliver Henshaw 2014-11-10 17:03:02 UTC
The _pnames() bash completion appears to be unchanged since the original report. But somehow I missed that killall and pidof use it and do indeed work with "command" and not the truncated "comm".

But the problem remains that pgrep/pkill expect "comm" by default and are given "command" by the completion. So they would need a new _pnames_short completion that returns the truncated "comm".

Another example:

$ pgrep systemd-journald 
$ pgrep systemd-journal
592
$ pgrep -f systemd-journald
592

$ pidof systemd-journal
$ pidof systemd-journald
592

Comment 10 Ville Skyttä 2014-11-10 20:39:40 UTC
Ah, got it. Should be fixed upstream now: http://anonscm.debian.org/cgit/bash-completion/bash-completion.git/commit/?id=52d8316

Comment 11 Fedora Update System 2014-11-10 21:32:23 UTC
bash-completion-2.1-6.20141110git52d8316.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/bash-completion-2.1-6.20141110git52d8316.fc21

Comment 12 Fedora Update System 2014-11-12 02:36:41 UTC
Package bash-completion-2.1-6.20141110git52d8316.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing bash-completion-2.1-6.20141110git52d8316.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-14732/bash-completion-2.1-6.20141110git52d8316.fc21
then log in and leave karma (feedback).

Comment 13 Fedora Update System 2014-11-15 09:09:40 UTC
bash-completion-2.1-6.20141110git52d8316.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.


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