You are not logged in.

#1 2012-07-11 20:43:57

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,143

Can't pkill an xterm

I just try pkill xterm and here is the result:

[oesser@xxxxxxxxx ~]$ pkill xterm
pkill: no matching criteria specified
Try `pkill --help' for more information.

pkill works properly except that it does not want to kill xterm ?! The only explanation that I see is that pkill mistake "xterm" for options. But it does not seems to support the "--" (end of options). Anyway that is weird...

Last edited by olive (2012-07-11 20:46:39)

Offline

#2 2012-07-11 20:47:00

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 14,208
Website

Re: Can't pkill an xterm

have you tried preg to verify that the process is called 'xterm'?


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#3 2012-07-11 20:51:11

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,143

Re: Can't pkill an xterm

Trilby wrote:

have you tried preg to verify that the process is called 'xterm'?

Yes and pgrep does find the xterm. Anyway pkill does not fail like that if it cannot find a process:

[oesser@xxxxxxxxx ~]$ pkill jhfjhzefjherfzezezfz
[oesser@xxxxxxxxx ~]$ echo $?
1
[oesser@xxxxxxxxx ~]$ pkill xterm
pkill: no matching criteria specified
Try `pkill --help' for more information.
[oesser@xxxxxxxxx ~]$ echo $?
1

pkill xterm fails the same way as if you call pkill without any argument.

Last edited by olive (2012-07-11 20:54:19)

Offline

#4 2012-07-11 21:20:08

2ManyDogs
Member
Registered: 2012-01-15
Posts: 1,706

Re: Can't pkill an xterm

I can confirm that this happens on my Arch install as well. To kill xterm I have to use

kill $(pidof xterm)

If I just use "pkill xterm" I get the same error Olive gets. On the other distros I have available, "pkill xterm" does work.

(edit) removed "-9" from the kill command (got that from a google search, obviously not a good idea and it works without; thanks MrCode)

Last edited by 2ManyDogs (2012-07-11 22:01:10)

Offline

#5 2012-07-11 21:28:07

MrCode
Member
Registered: 2010-02-06
Posts: 373

Re: Can't pkill an xterm

I'm getting the same thing, actually: hmm

lappy486 ~ $ pkill "xterm"
pkill: no matching criteria specified
Try `pkill --help' for more information.
lappy486 ~ $ pgrep "xterm"
28211
lappy486 ~ $ kill `pgrep "xterm"`
lappy486 ~ $

BTW, I'd seriously recommend against using (p)kill -9, except in bad emergencies; it doesn't allow processes to do cleanup/free memory before being removed from the process queue.

EDIT: This isn't really a problem for me, as I don't use plain xterm.  I was just chiming in because I was able to reproduce the issue.

Last edited by MrCode (2012-07-11 21:29:30)

Offline

#6 2012-07-14 22:46:59

andy753421
Member
Registered: 2010-06-02
Posts: 6

Re: Can't pkill an xterm

I stumbled across this post while trying to figure out why i can't pkill dbus. As it turns out procps-ng v3.3.3 has a bug that causes it to interpret `xterm' as `-term' and `dbus' as `-bus'. I.e it skips the first character when trying to match signal names..

Anyway, this appears to be fixed, perhaps accidentally, here:

  - https://gitorious.org/procps/procps/com … dbe7066ac1

You should be able to `pkill xter' without a problem, assuming you don't have any other programs running that match xter..

Offline

Board footer

Powered by FluxBB