[lxc-devel] Please make "-f" mandatory in lxc-create

richard -rw- weinberger richard.weinberger at gmail.com
Mon May 28 22:50:07 UTC 2012


On Tue, May 29, 2012 at 12:36 AM, Stéphane Graber <stgraber at ubuntu.com> wrote:
> On 05/28/2012 06:29 PM, richard -rw- weinberger wrote:
>> On Tue, May 29, 2012 at 12:06 AM, Stéphane Graber <stgraber at ubuntu.com> wrote:
>>> At least in Ubuntu -f isn't mandatory because calling lxc-create without
>>> it will simply default to a system wide configuration in /etc/lxc/lxc.conf.
>>
>> Is this really useful?
>> My openSUSE system does not have /etc/lxc/lxc.conf,
>> so lxc-create will create an empty config file in /var/lib/lxc/.
>>
>> IMHO the current behavior is error prone and not logical.
>
> For distros where lxc creates a bridge by default and ships such a
> default configuration file, it's very useful as people on Ubuntu can
> simply do:
>  - apt-get install lxc
>  - lxc-create -t ubuntu -n container

Doesn't this trigger this ugly warning?

    if [ -z "$lxc_config" ]; then
	echo
	echo "Warning:"
	echo "-------"
	echo "Usually the template option is called with a configuration"
	echo "file option too, mostly to configure the network."
	echo "eg. lxc-create -n foo -f lxc.conf -t debian"
	echo "The configuration file is often:"
	echo
	echo "lxc.network.type=macvlan"
	echo "lxc.network.link=eth0"
	echo "lxc.network.flags=up"
	echo
	echo "or alternatively:"
	echo
	echo "lxc.network.type=veth"
	echo "lxc.network.link=br0"
	echo "lxc.network.flags=up"
	echo
	echo "For more information look at lxc.conf (5)"
	echo
	echo "At this point, I assume you know what you do."
	echo "Press <enter> to continue ..."
	read dummy
    fi

Anyway, can we at least print a fat warning if no rootfs is set?

-- 
Thanks,
//richard




More information about the lxc-devel mailing list