On Tuesday 27 March 2007 13:28, [EMAIL PROTECTED] wrote: > Natanael Copa wrote: > > On Tue, 2007-03-27 at 09:16 +0200, [EMAIL PROTECTED] wrote: > >> Hello, > >> > > > > Use start-stop-daemon -n or with pidfiles. > > > > Ok, thanx. > I've tried -m -p /var/lock/pidfile and strange thing happens - actual > PID number recoreded in the pidfile doesn't belong to the daemon being > started. It belongs to the process that already finished. Eg. > > # start-stop-daemon --start -m -p /var/lock/crond.pid -x /sbin/crond -- > -c /etc/crontab/ > > # ps > ... > 4274 root 192 S /sbin/crond -c /etc/crontab/ > > # cat /var/lock/crond.pid > 4272
start-stop-daemon --start -m -p z.pid -x /bin/sleep 100 Pidfile contains 12422 and in ps output I see: 12422 root /bin/sleep 100 You don't see it because you start _self-daemonizing_ applets - they fork and then parent exits. Of course start-stop-daemon records PID of parent process! Which leads me to a question "why do you need start-stop-daemon at all" if you can do the same in shell: #!/bin/sh echo $$ >z.pid; exec /bin/sleep 100 Simple, huh? -- vda _______________________________________________ busybox mailing list [email protected] http://busybox.net/cgi-bin/mailman/listinfo/busybox
