[BusyBox] pidof problem

Gabor Z. Papp gzp at papp.hu
Tue Apr 20 07:14:49 UTC 2004


Something goes wrong here with pidof. :-)

Running the latest cvs busybox compiled against glibc 2.2.5 using the
linux kernel 2.4 series, I have found pidof does not work correctly.

I wrote a script to start/stop the nfs services, where the stop part
look something like this:

exportfs -au
kill -9 `pidof mountd 2>/dev/null` 2>/dev/null
kill -9 `pidof nfsd 2>/dev/null` 2>/dev/null
kill -9 `pidof statd 2>/dev/null` 2>/dev/null
kill -9 `pidof lockd 2>/dev/null` 2>/dev/null
modprobe -r nfsd

I was using 2>/dev/null to supress the non existing process error
messages. The stop process breaked abnormally with an error message
"Killed" and the statd process was not killed.

I was trying to reproduce the bug from the command line, but never
got the message "Killed" but every time I use the init.d/nfs script,
getting the problem.

Some more debug info here: http://gzp.odpn.net/tmp/busybox/

As hotfix, I'm using the sysvinit 2.85 pidof program, and that solved
the problem.



More information about the busybox mailing list