Unix Programming - "killall" madness

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > May 2005 > "killall" madness





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author "killall" madness
subnet

2005-05-24, 6:04 pm

I'm running linux slackware 10.1, kernel 2.6.11.2. The "killall"
command used to work correctly, but in the last days it doesn't work
anymore (apparently with no reason).

$ yes > /dev/null &
[1] 3111
$ killall yes
yes: no process killed
$ kill 3111
$
[1]+ Terminated yes >/dev/null
$

and the same goes for every program. This is particularly annoying
since the shutdown scripts use that command a lot (to shut down pppd,
mysql, etc.). I already tried to reinstall the executable from the
original slackware package, but nothing changed.

Any ideas? Someone saw this before?

Thanks for any help

Jim Cochrane

2005-05-24, 6:04 pm

In article <1116966969.908316.164830@g43g2000cwa.googlegroups.com>, subnet wrote:
> I'm running linux slackware 10.1, kernel 2.6.11.2. The "killall"
> command used to work correctly, but in the last days it doesn't work
> anymore (apparently with no reason).
>
> $ yes > /dev/null &
> [1] 3111
> $ killall yes
> yes: no process killed
> $ kill 3111
> $
> [1]+ Terminated yes >/dev/null
> $
>
> and the same goes for every program. This is particularly annoying
> since the shutdown scripts use that command a lot (to shut down pppd,
> mysql, etc.). I already tried to reinstall the executable from the
> original slackware package, but nothing changed.
>
> Any ideas? Someone saw this before?
>
> Thanks for any help
>


Have you checked to see if killall has been corrupted? - e.g.:

$ rpm -qf /usr/bin/killall
psmisc-21.4-2
$ rpm -V psmisc-21.4-2


--
Jim Cochrane; jtc@dimensional.com
[When responding by email, include the term non-spam in the subject line to
get through my spam filter.]
subnet

2005-05-24, 6:04 pm

> Have you checked to see if killall has been corrupted? - e.g.:
>
> $ rpm -qf /usr/bin/killall
> psmisc-21.4-2
> $ rpm -V psmisc-21.4-2


I redownloaded the procps package from slackware. (contains ps, free,
killall, w, top, pmap, fuser, lsdev, pkill, skill, tload, watch,
slabtop, pstree, uptime, vmstat, procinfo, socklist, sysctl) and did a
fresh reinstall, but nothing changed. I also recompiled the kernel to
no avail.

Thanks

Måns Rullgård

2005-05-24, 6:04 pm

"subnet" <sunglo@katamail.com> writes:

>
> I redownloaded the procps package from slackware. (contains ps, free,
> killall, w, top, pmap, fuser, lsdev, pkill, skill, tload, watch,
> slabtop, pstree, uptime, vmstat, procinfo, socklist, sysctl) and did a
> fresh reinstall, but nothing changed. I also recompiled the kernel to
> no avail.


Try running strace on killall to see what it's really doing.

--
Måns Rullgård
mru@inprovide.com
David Schwartz

2005-05-24, 8:48 pm


"Måns Rullgård" <mru@inprovide.com> wrote in message
news:yw1xll64w7u3.fsf@ford.inprovide.com...

> Try running strace on killall to see what it's really doing.


Good advice. You may find something obvious, like /proc not being
mounted or permissions being set improperly.

DS


subnet

2005-05-25, 6:02 pm

> Try running strace on killall to see what it's really doing.

Here are the outputs on my machine and on another box where killall
works.

The working one (yes has pid 29966)

$ strace killall yes
....
open("/proc/29966/stat", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0x40014000
read(3, "29966 (yes) R 29782 29966 29782 "..., 4096) = 178
close(3) = 0
munmap(0x40014000, 4096) = 0
kill(29966, SIGTERM) = 0
open("/proc/29967/stat", O_RDONLY) = 3
....

And here is the ouput of the broken killall (yes has pid 2336):

$ strace killall yes
....
open("/proc/2336/stat", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0xb7e6c000
read(3, "2336 (yes) R 2325 2336 2325 3481"..., 1024) = 176
close(3) = 0
munmap(0xb7e6c000, 4096) = 0
stat64("/proc/2336/exe", {st_mode=S_IFREG|0755, st_size=12212, ...}) =
0
open("/proc/2337/stat", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
....
and kill() is not called.

The first killall is version killall (psmisc) 20.2, and the "broken"
one (worked until two days ago) is killall (psmisc) 21.4. Seems to me
that the difference is that the newer version also opens
/proc/<pid>/exe, and the old_mmap() return values are quite different
but, apart from that, I see nothing that could give some clue about the
wrong behaviour.

Thanks for your replies.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com