Hi

I checked various start-stop-daemon manpages on the net and they
seem to all specify checking /proc/pid/exe instead.

That's quite possible, but just to be clear, what I observe with at least the gentoo one is that -IFF you specify --exec AND --pid-file, then it relaxes the exec test and does a substring search.

So this appears to allow me to to use a substring match in --exec - which I think with a bit of thought, actually makes a lot of sense in the event that we have a pid. I don't see that this is likely to cause problems with regards to compatibility with other s-s-d implementations, it's already a fairly tight "and" test.


But there is a reason why we check /proc/pid/cmdline instead.
On systems with bbox, a lot of processes will have
/proc/pid/exe = "/bin/busybox".
Which will make e.g.
start-stop-daemon --stop --exec /bin/ntpd
fail to stop ntpd if ntpd is a busybox applet.

I examined the code for openrc and I can't find any obvious reference to /proc/pid/exe ? I confess I don't understand the implementation they are using, but I think the relevant code is in src/librc/librc-daemon.c if someone else could take a closer look?



I think we need to first check /proc/pid/exe,
and then check /proc/pid/cmdline as we do now.

Can we please consider simply relaxing the current test to be a substring match on /proc/pid/cmdline (only in the case of both --exec AND --pidfile)? This seems to
a) be a small code change and completely compatible with current situation
b) still a very tight test and unlikely to lead to false positives
c) handles common situations where a daemon renames itself


Thanks

Ed W
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to