You are not logged in.

#1 2019-02-25 14:14:26

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,393

[SOLVED] New behaviour of "killall" (-e) ?

tl;dr:
Killall seems to default to -e with no option to revert it?

I think i've this problem since some months:

koko@Gozer# ps -ef|grep xbind
koko      7209  5603  0 15:11 pts/6    00:00:00 grep --colour=auto xbind
koko     31092 30723  0 15:02 pts/4    00:00:00 /home/koko/.config/gambas3/higgins/xbindkeys_higgins -n -f /home/koko/.config/gambas3/higgins/higgins.xb.rc

koko@Gozer# killall xbindkeys_higgins
xbindkeys_higgins: no process found

From killall man:

       -e, --exact
              Require  an  exact  match  for very long names.  If a command name is longer than 15 characters, the full name may be unavailable (i.e.  it is swapped out).  
              In this case, killall will kill everything that matches
              within the first 15 characters.  With -e, such entries are skipped.  killall prints a message for each skipped entry if -v is specified in addition to -e,

killall uses stat from proc:

koko@Gozer# cat /proc/31092/stat
31092 (xbindkeys_higgi) S 30723 31092 30723 34820 30723 4194304 1152 0 0 0 1 0 0 0 20 0 4 0 232656 44294144 2254 18446744073709551615 94245432164352 94245432193989 140726232171152 0 0 0 0 4096 545325057 0 0 0 17 3 0 0 0 0 0 94245432216432 94245432217620 94245455302656 140726232178294 140726232178402 140726232178402 140726232182723 0
koko@Gozer# killall xbindkeys_higgi  #<-- does indeed work.

Is this intended or just a bug?

Last edited by kokoko3k (2019-02-27 08:53:54)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#2 2019-02-25 14:30:46

loqs
Member
Registered: 2014-03-06
Posts: 17,322

Re: [SOLVED] New behaviour of "killall" (-e) ?

Offline

#3 2019-02-25 19:36:10

escondida
Package Maintainer (PM)
Registered: 2008-04-03
Posts: 157

Re: [SOLVED] New behaviour of "killall" (-e) ?

As a side note, if you disable your shell's built-in kill (which masks kill(1) for historical reasons), you can use /usr/bin/kill (which can take either a pid or a process name) instead of killall.

Offline

#4 2019-02-27 08:53:41

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,393

Re: [SOLVED] New behaviour of "killall" (-e) ?

Thanks, so it is a matter of waiting for the next version to be packaged.
Meantime i can use /usr/bin/kill
Thank you!


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#5 2019-03-14 10:18:49

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,393

Re: [SOLVED] New behaviour of "killall" (-e) ?

unfortunately /usr/bin/kill does not work either.

koko@Gozer# /usr/bin/kill telegram-desktop
kill: cannot find process "telegram-desktop"
koko@Gozer# pidof telegram-desktop
26490

Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#6 2019-03-14 10:48:48

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 1,976
Website

Re: [SOLVED] New behaviour of "killall" (-e) ?

/usr/bin/kill takes a process ID, not a process name.
Just realized, it actually does.
The error also occurs, if you try to kill another user's process.

$ sudo cat &
$ LANG=C /usr/bin/kill cat
kill: cannot find process "cat"
$ pidof cat
1595

Last edited by schard (2019-03-14 11:04:29)


macro_rules! yolo { { $($tokens:tt)* } => { unsafe { $($tokens)* } }; }

Offline

#7 2019-03-14 22:55:10

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: [SOLVED] New behaviour of "killall" (-e) ?

kokoko3k wrote:

unfortunately /usr/bin/kill does not work either.

koko@Gozer# /usr/bin/kill telegram-desktop
kill: cannot find process "telegram-desktop"
koko@Gozer# pidof telegram-desktop
26490

There is a tool "pkill" that you can use. It should be installed by default because it is in a package that is part of the Arch "base" group. You can experiment with the tool "pgrep" to see what "pkill" will find and try to kill.

Offline

#8 2019-03-15 06:02:10

waitnsea
Member
From: France
Registered: 2013-02-10
Posts: 57

Re: [SOLVED] New behaviour of "killall" (-e) ?

escondida wrote:

As a side note, if you disable your shell's built-in kill (which masks kill(1) for historical reasons), you can use /usr/bin/kill (which can take either a pid or a process name) instead of killall.

=> add "enable -n kill" in your .bashrc to disable this bash's built-in function (doesn't work in zsh => use "disable kill" instead in your .zshrc)

Last edited by waitnsea (2019-03-15 06:28:02)

Offline

#9 2019-03-18 12:39:28

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,393

Re: [SOLVED] New behaviour of "killall" (-e) ?

Ropid wrote:
kokoko3k wrote:

unfortunately /usr/bin/kill does not work either.

koko@Gozer# /usr/bin/kill telegram-desktop
kill: cannot find process "telegram-desktop"
koko@Gozer# pidof telegram-desktop
26490

There is a tool "pkill" that you can use. It should be installed by default because it is in a package that is part of the Arch "base" group. You can experiment with the tool "pgrep" to see what "pkill" will find and try to kill.

Still nothing:

koko@Gozer# ps -ef|grep telegram-desktop
koko      5690 21312  0 13:34 pts/11   00:00:00 grep --colour=auto telegram-desktop
koko     19010 19006  0 08:45 ?        00:00:58 telegram-desktop -startintray
koko@Gozer# pgrep telegram-desktop
koko@Gozer# pkill telegram-desktop  
#(nothing killed)

it seems my best bet is something like:

koko@Gozer# nkill(){ for p in `pidof "$1"` ; do echo kill "$p" ; done };
koko@Gozer# nkill telegram-desktop
kill 19010
koko@Gozer# nkill bash|head
kill 32582
kill 29388
kill 25336
kill 23710
kill 23679
kill 23662
kill 21312
kill 19006
kill 17768
kill 17724

Last edited by kokoko3k (2019-03-18 12:42:54)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

Board footer

Powered by FluxBB