On 04/03/2012 16:30, [email protected] wrote:
Hallo Ed!
start-stop-daemon --stop --pidfile /var/run/nginx.pid
Yes this works. Up until recently that's exactly what gentoo used,
but they have now started to switch their init scripts to be more
specific with --exec
I guess this also defends against services which die in the
background and something else ends up accidently running on the same
pid
My start-stop-daemon from Gentoo killed processes if they EITHER
matched the pid from file OR the given exec name. As this killed
sometimes the wrong process I switched to Busybox start-stop-daemon
witch killed only the process when both conditions met (pid AND name).
But that test was back in last year spring. May be things changed since
this.
Testing with openrc-0.9.8.2 I see that it's an "AND" and further that
either mangling my pid file or selecting only --exec fails to kill my
process
At least in this case it seems like if there is a pidfile then the
--exec is loosened to being non anchored in the cmdline. For example
this worked fine:
start-stop-daemon --stop --exec /sbin/nginx --pidfile /var/run/nginx.pid
However, this didn't (which I'm not sure I like...):
start-stop-daemon --stop --exec /usr/sbin/nginx
IMHO is the Busybox choice better to kill only processes if all
specified conditions match. I dislike the other approach ... but it is
not my decision if Busybox or upstream behavior shall be changed.
I think the only change is that my s-s-d takes a non anchored --exec
parameter, ie it can occur anywhere in the cmdline. This seems
reasonable to me and useful in the case of daemons which augment their
cmdline to show status, etc
Any chance of such a change to busybox?
Thanks
Ed W
--
Harald
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox