start-stop-daemon incorrect pid

Natanael Copa natanael.copa at gmail.com
Mon Aug 28 15:00:41 UTC 2006


On Mon, 2006-08-28 at 16:43 +0200, Rory Vieira wrote:
> Hi,
> 
> now that I've built the basic initramfs (from buildroot), I'm writing
> scripts to start/stop services.
> 
> I'm trying to use start-stop-daemon to do this:
> 
> start-stop-daemon -S -x /usr/sbin/telnetd -m /var/run/telnetd.pid -p
> /var/run/telnetd.pid
> 
> When checking the pid file, I noticed that the wrong pid is entered
> (usually two less that it should be).
> How can I come around this?

This is probably because telnetd forks and returns the pid of the
parent. You can't use the pid (unless you can make telnetd create it for
you). Use --exec and --name instead.

btw... the "start-stop-daemon --stop --pidfile ...." is noisy. I'm not
sure how the debian start-stop-daemon is but in gentoo its more quiet by
default. (start-stop-daemon in gentoo is based on the debian one)

/var/home/ncopa $ sudo /etc/init.d/rsyncd stop
 * Stopping rsyncd: stopped process in pidfile `/var/run/rsyncd.pid' (pid 26877).
ok.

It should look like:
 * Stopping rsyncd: ok.

I have to either
1. patch busybox to behave. (or just be lazy and file a bug of it)
2. patch every init.d script (there are too many)
3. live with the ugly output and endusers future complains

--
Natanael Copa




More information about the busybox mailing list