[lxc-devel] [PATCH 3/3] Let lxc-start read container name from rcfile if not specified on command line

Michael Holzt lxc at my.fqdn.org
Sat Jan 9 08:13:13 UTC 2010


> Does is mean the purpose of these three patches, is only
> to have the -n/--name parameter to not be mandatory for
> the lxc-start command ? and be able to place it in the rcfile ?

Yes, that is the purpose and in my opinion the right thing to do.
It should absolutely be possible to start a container with only
providing a rcfile. Xen does is that way, and i believe openvz and
vserver as well. This allows e.g. to create a /etc/init.d/lxc-container
which on start can loop through /etc/lxc/auto/*conf and start all
containers. This would also be possible by deriving the container 
name from the file name, but that is a ugly hack in my opinion. 

Please note that my patch maintains old behaviour and still allows to
specify the container name on the command line. But this patch is
the smaller solution to my aim to make the lxc commands easier to 
use and handle. 

I outlined my rationale the other day in my mail and Daniel replied with
"No problem for adding the container name in the configuration file", so
i did that. As suggested by Daniel and ack'd by me the goal is to have
a "lxc" executable which will invoke the lxc-* commands and to keep that
tool as simple as intended, i needed lxc-start to be able to start with
only the config file, which is also enough.

> For me I do not think this is a good thing to introduce in
> the rcfile of the container a name that is only here
> to manage the container in the host.

The container name is a config value in the end like everything
else. Aren't all the other config values also "only there to
manage the container in the host"? The whole config file just
contains values needed to setup the container, and the name of
it (from which the cgroup name is derived) is just one of those
values.

It seems odd why one config value needs to be separated from the
others.

> For me the name is something that is outside the container itself.

Like e.g. the interface we bridge the network adapter to and which
is specified in rcfile? Or the path to the rootfs which is only 
known as / in the container?




Regards
Michael

-- 
It's an insane world, but i'm proud to be a part of it. -- Bill Hicks




More information about the lxc-devel mailing list