On Sun, Mar 4, 2012 at 2:35 PM, Ed W <[email protected]> wrote:
> Hi, I see a difference in behaviour between "real" start-stop-daemon on
> gentoo and busybox version.  Specifically nginx renames it's parent process
> commandline name:
>
> # cat /proc/`cat /var/run/nginx.pid`/cmdline
> nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
>
> However, I can stop it without a problem on "real" start-stop-daemon
> # start-stop-daemon --stop --exec /usr/sbin/nginx --pidfile
> /var/run/nginx.pid
>
> However, using busybox start-stop-daemon I get an error
>
> $ start-stop-daemon --stop --exec /usr/sbin/nginx --pidfile
> /var/run/nginx.pid
> no /usr/sbin/nginx found; none killed

The problem is that bbox checks /proc/pid/cmdline to start
with "/usr/sbin/nginx",NUL

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

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.

> Can anyone please help with a fix?

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

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

Reply via email to