[PATCH] start-stop-daemon: close extra fds on --background

Denys Vlasenko vda.linux at googlemail.com
Tue Jul 1 12:03:00 UTC 2008


On Tuesday 01 July 2008 10:53, Roy Marples wrote:
> On Tuesday 01 July 2008 09:27:22 Andreas Wetzel wrote:
> > hi again,
> >
> > in start-stop-daemon, if --background is given, i think we should
> > completely detach the called process, including closing all extra
> > file-descriptors.
> > for non-mmu, this seems to be the case. but if BB_MMU is set, we do not
> > set the DAEMON_CLOSE_EXTRA_FDS flag when calling bb_daemonize.
> >
> > the attached patch sets this flag, therefore makes the behaviour
> > consistent for the mmu and non-mmu case (diffed against the
> > busybox_1_9_stable branch).
> 
> I would expect this to work
> 
> echo "password" | 
> start-stop-daemon --start --exec /usr/sbin/pppd --background -- plugins 
> passwdfd 0
> 
> Your patch would break that yes?

It already does not work, if I read code correctly (bb_daemonize() closes fds 0,1,2).
--
vda



More information about the busybox mailing list