start-stop-daemon: stopping daemons on unionfs fails

pieterg pieterg at gmx.com
Sun Apr 6 13:40:08 UTC 2008


Stopping a daemon with the -x argument fails on unionfs.

The reason is that pid_is_exec (debianutils/start_stop_daemon.c) looks where 
the /proc/<pid>/exe symlink points to, but that is not necessarily the real 
location of the executable in the filesystem.

For instance, on unionfs, one could have the following 'exe' symlink:
/proc/1234/exe -> /boot/mnt/flash/delta/usr/bin/djmount

while the process was started as /usr/bin/djmount.

As a result, attemping to stop it with 
start-stop-daemon -K -x /usr/bin/djmount will fail.

Would there be any drawback to using the contents of /proc/<pid>cmdline 
(stringcompare up to the first null character), instead of the exe symlink, 
in pid_is_exec?
I believe that would solve not only the problems on unionfs, but would also 
allow to find the right process if the command used a symlink, for instance 
with a multi-call binary.

Rgds, Pieter



More information about the busybox mailing list