-
Notifications
You must be signed in to change notification settings - Fork 380
-
Notifications
You must be signed in to change notification settings - Fork 380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Completion for killall doesn't work #90
Comments
The suggested approach is apparently Linux specific, so it cannot be just slapped in (the place to do this is the |
Hello, sorry for digging this up, but I fixed this in my bashrc by redefining _killall and calling '_pnames -s' instead of just '_pnames'. I am not familiar with Solaris & others but it seems _pnames is defined differently on those OS's so it should not do anything. I can make the patch if you agree with that statement. |
@ThomasFaivre it would be good to first hear what exactly doesn't work for you, and what is your OS and version. |
Fair enough. Debian 10
How to reproduce:
Read too fast the original post, I don't know about the space issue but I saw that pnames was reworked so that might have already been fixed. I don't know. Using '_pnames -s' here, fixes this issue for me:
|
I think |
I can do that on monday, but I don't really understand. Qemu basename is qemu-system-x86_64 which is longer than 15, that is why I need to strip '_64' to make killall command happy
I used the
Am I missing something here? |
Oh, I missed the x86 vs x86_64 difference. But for me on Ubuntu 18.04, killall seems to work with the complete process names, not abbreviations, so I believe switching to $ ps wax | grep [g]sd-print-noti
2203 tty1 Sl+ 0:00 /usr/lib/gnome-settings-daemon/gsd-print-notifications
3973 tty2 Sl+ 0:00 /usr/lib/gnome-settings-daemon/gsd-print-notifications
$ ps axo comm= | grep [g]sd-print-noti
gsd-print-notif
gsd-print-notif
$ killall -s 0 gsd-print-notif
gsd-print-notif: no process found
$ killall -s 0 gsd-print-notifications
$ echo $?
0 |
Also: $ killall -vi at-spi2-registryd
Kill at-spi2-registr(3595) ? (y/N) n
at-spi2-registryd: no process found <<< also due to the 'n' choice
$ killall -vi at-spi2-registr
at-spi2-registr: no process found |
It seems it was fixed in killall: https://gitlab.com/psmisc/psmisc/-/blob/master/ChangeLog#L19 It was backported to ubuntu 18.04, and is present in Ubuntu 20.04 and Debian testing (future 11) I can live with the workaround in my bashrc (or I could upgrade to testing version). Do we still want to do something here? Probably not useful since Debian 10 wil probably not ship the fix we make... |
Ok, confused here. psmisc 23.2 according to the referred changelog entry is supposed to work with the longer process names ("Command names increased from 16 to 64 characters" I guess), right? Your report says you have 23.2 but it actually doesn't work with the long ones, but only the truncated ones? |
Hmmm that's very true. Let's try that again: I believe the issue was actually introduced in 23.2 with this commit (and a fix): https://gitlab.com/psmisc/psmisc/-/commit/1e2f38a202798a78554ae5f5d12f697f3607f89f This was done to handle the new comm length for "new kernel". Modification I still can't understand since kernel 5.12-rc1 still uses 16 as TASK_COMM_LEN: https://github.com/torvalds/linux/blob/master/include/linux/sched.h#L215 And someone got as confused as me: https://gitlab.com/psmisc/psmisc/-/issues/19 But anyway, it was fixed in 23.3: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=912748 <<< this is actually the issue I'm seeing. Found in changelog for 23.3 To summarize: Ubuntu-18.04: Version is 23.1-1ubuntu0.1 - does not handle the new comm length of 64 => No issue So yeah, I don't think anything should change here. I have contacted the maintainer for the psmisc package about releasing the fix in Debian 10, but maybe a debian patch should be added to the bash-completion package in (and only in) Debian 10 to handle that specific issue. It will depend on the answer from the maintainer. Sorry for the noise! |
No problem, thanks for the thorough detective work. Guess we should keep this open anyway as I gather at least some of the originally reported issues still do persist. |
The completion for killall has a number of issues, one of them is the linux kernel 16-byte process name limitation.
Also, processes started from a directory with a space in their name, or with a space in their process name, fail.
I haven't really looked into how to write bash completion scripts, but here's how you could get a better process name list:
cut -z -d "" -f 1 /proc/*/cmdline | xargs -0 -n1 basename
The text was updated successfully, but these errors were encountered: