Hi Jan,
  I had a look at the specific part of killall and it already calculates
the length of process command names and given options so it was a simple
matter of adding an additional check.

https://gitlab.com/psmisc/psmisc/commit/1188315cd037d73bf946a0003b70c6423cc330d2

So if the process command name is 15 characters and the given name is 15 or
more characters, try to match on the 1st 15 characters only.

I tested it with a long named process:
$ ../alongnametestprocess.sh &
[1] 9830
$ ps -o comm 9830
COMMAND
alongnametestpr
$ src/killall alongnametestprocess
[1]+  Terminated              ../alongnametestprocess.sh

 - Craig

-- 
Craig Small             https://dropbear.xyz/     csmall at : dropbear.xyz
Debian GNU/Linux        https://www.debian.org/   csmall at : debian.org
Mastodon: @[email protected]             Twitter: @smallsees
GPG fingerprint:      5D2F B320 B825 D939 04D2  0519 3938 F96B DF50 FEA5

Reply via email to