[lxc-devel] current git: lxc-start now requires -f ?

Michael Tokarev mjt at tls.msk.ru
Mon Nov 16 14:13:26 UTC 2009


Andrian Nord wrote:
> On Mon, Nov 16, 2009 at 04:04:05PM +0300, Michael Tokarev wrote:
>> lxc.mount.entry *does* use fstab syntax _and_ use mntent.h API.
> 
> Yeap. And that's why it's hard to process this entries without
> temporary files (or we should reimplement parsing process).

There's really nothing to parse: getmntent() just splits the line
into 5 fields.

>> lxc.mount.entry = /dev dev none bind 0 0
[]
> Any following actions (warnings, changing real default etc.) is distro
> packagers decision. As for me - as soon as --with-config-path would be in
> tree, I'll change Gentoo ebuild I'm working on, to use /etc/lxc instead of
> /var/lib/lxc
> 
>>   2) continue using /var/lib/lxc/$name/config as a default config location,
>>    at least for some transition/historic period
> 
> And this is done (twicely) by mine patch. So what's the problem? =)

I think I overlooked that you're using /var/lib/lxc too.

>> Besides, we should think how we want to configure things in the future.
>> Many different ways makes little sence, including your foo.conf and foo/config
>> or even plain foo choice.  If one makes more sense than another pick it, but
>> don't pick both as it adds confusion.  That's a question about where we want
>> to go from here.
> 
> Best way - let user to choose. It's may be done now (again), via
> changing --with-config-path. Lately some kind of global lxc.conf config
> may be useful, but not now, and not very soon, I suppose, so I prefer
> not to mind it now. There is many other issues, for example lxc_init
> reimplementation, that are more important.
> 
>> As for the direction to move, I'd go for /etc/lxc/$name.conf or even
>> /etc/lxc/containers/$name.conf.  Subdir makes sense because I bet there will
> 
> My latest patch allows it (with changing LXCPATH, of course).
> 
>> be some common scripts - for example to start/stop things or configure
>> networking (maye /etc/lxc/scripts/ is ok too), and there should be a place
> 
> You are trying to reinvent an vzctl script-system, right? Maybe it would
> be useful, but let's extract this to separate thread, ok? =)

I don't know how vzctl works, never looked that way.  What I do know is once
you start managing "n" similar things (containers, virtual machines, network
tunnels (ppp or vtun or openvpn for example) and so on and so forth), you'll
have a set of scripts that should be keept somewhere.  For example, I've a
script in /etc/vtun/notify.sh that sends email when certain vtun tunnels
goes up or down, and that directory contains a bunch of other scripts used
for various groups of tunnels to configure things and perform statistics and
logging.

>> to provide a list of containers to start at boot (like /etc/lxc/auto/
>> with symlinks to /etc/lxc/container/*). Alternative to subdirs (besides
>> /etc/lxc/auto/) is the .conf suffix.  Ok, /etc/lxc/$name.conf is probably
>> the best choice still.
> 
> I'm using 'touch autoboot' for this task. It's extremely simple, if you
> are using dirs. But probably this is a talk about distro's rc-system, not
> utilities themselves (i.e. that, probably, shouldn't be discussed here,
> until there is some features that would be nice for rc-scripting) ;)

Not really, not distro-specific.  In a way that there should be at least
some _suggested_ way about how to things like autostart supposed to work.
So on different distros it's done similarly.  As of autoboot, yes, that
looks nice too.  And having a list of container names in a separate file
named 'autostart' or 'containers.boot' is useful too, together with
individual per-container options.

By the way, lxc-start should probably create (and lock) a file named
/var/run/lxc/$name.pid for rc-scripting purposes, or maybe ../lxc/$name-init.pid
with a pid of container's init process.  But this is indeed another
thread's matherial.

> Summarizing: with two already mentioned patches you may use any
> configuration scheme you want to (in assumption that LXCPATH=/etc/lxc):
> /etc/lxc/example.conf
> /etc/lxc/example
> /etc/lxc/example/config

Yes that works.  Still -ETOOMANY I think :)

/mjt




More information about the lxc-devel mailing list