[lxc-devel] [PATCH v2 1/2] Add option to lxc-attach to select specific namespaces

Serge Hallyn serge.hallyn at canonical.com
Tue May 22 15:53:39 UTC 2012


Quoting Christian Seiler (christian at iwakd.de):
> Hi Serge,
> 
> >>What about if we update the command interface to add an additional
> >>command along the lines of LXC_COMMAND_GET_NSFLAGS or similar, which
> >>returns the bitmask of CLONE_* used for starting the container? Then
> >>we would have the logic:
> >
> >That works fine for persistent containers which were started without
> >any command line changes.  But even with a persistent container with
> >no network section, I could add a network section on the lxc-start
> >command line with '-s' arguments, making the set of cloned namespaces
> >different from what you'd expect from the config file.  So there is
> >no good way I can think of, generally, to get that bitmask of CLONE_*
> >flags used for starting the container.
> 
> You misunderstood me: I don't want to read the configuration file - I
> want to ask the still-running lxc-start process (that listens on the
> abstract socket for the container) to give me the flags it used when
> it was run. Just as it may be asked to return a file descriptor for
> the console or the PID of the init process. We don't have to generate
> any file or store anything, we can just keep the information in a
> simple variable that we return via the command interface in case
> lxc-attach (or somebody else) asks.

That sounds good :)

thanks,
-serge




More information about the lxc-devel mailing list