[lxc-devel] [PATCH v2] fix console stdin,stdout,stderr fds
Serge Hallyn
serge.hallyn at ubuntu.com
Fri Mar 7 23:58:07 UTC 2014
Quoting Dwight Engen (dwight.engen at oracle.com):
> On Fri, 7 Mar 2014 17:01:17 -0600
> Serge Hallyn <serge.hallyn at ubuntu.com> wrote:
>
> > Quoting Dwight Engen (dwight.engen at oracle.com):
> > > + if (lxc_console_set_stdfds(handler) < 0)
> > > + goto out_warn_father;
> > > +
> > > close(handler->sigfd);
> > >
> > > + if (lxc_check_inherited(handler->conf))
> > > + return -1;
> > > +
> >
> > Hi,
> >
> > so the reason why the lxc_check_inherited() was where it
> > was, was because at this point we've called tmp_proc_umount().
> > So in some cases /proc won't be mounted, and lxc_check_inherited()
> > finds the fds to close under /proc
>
> Ahh okay that makes sense, good catch. So it seems like I should leave
> lxc_check_inherited() where it was and then just put the call to
> lxc_console_set_stdfds() just before it since it looks like
> check_inherited() will leave 0,1,2 alone and close the original fds.
> Does that sound reasonable?
Yeah, that sounds good.
thanks,
-serge
More information about the lxc-devel
mailing list