[PATCH] start-stop-daemon --exec regression

Natanael Copa natanael.copa at gmail.com
Fri Apr 13 14:38:34 UTC 2007


Hi,

The start-stop-daemon --exec does a string compare with /proc/<pid>/exe
link target. This was introduced in a try to fix a "bug" where the
daemon is a link to /bin/busybox. For example:

  start-stop-daemon --start --exec /usr/sbin/inetd

ssd will check if the executable (which is busybox) is already running
and wil discover that it actually is (somebody is running the busybox
shell for example)

So strcmp and readlink was introduced in r16047.

However, the idea is flawed by design, since linux will not store the
link name in /proc/<pid>/exe but the real executable, so using readlink
and strcmp is completely useless. It is simply not possible to use
start-stop-daemon --exec with busybox applets, due to the nature of
linux.

So I suggest we go back to the origial behaviour, pre r16047, which
properly uses stat and compares st_dev and st_ino.

Patch attatched.

This could also close http://bugs.uclibc.org/view.php?id=324 

Natanael Copa
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bb-ssd-exec.patch
Type: text/x-patch
Size: 930 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20070413/f2fa6b66/attachment-0002.bin 


More information about the busybox mailing list