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

Andrian Nord nightnord at gmail.com
Mon Nov 16 13:55:41 UTC 2009


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).

> lxc.mount.entry = /dev dev none bind 0 0
> lxc.mount.entry = /dev/md8p2 stage ext3 defaults 0 0
> 
> It _aims_ to replace lxc.mount, in order to keep all configuration
> in a single file.  For now the two co-exists, and I see no reason
> to remove lxc.mount entirely either.

I know, I know, I'm speaking about vim syntax highlighting, it's will
not work if i'll embed fstab into lxc.mount.entries =)

> I see no specifics in "for using in scripts".  Every usage is ok
> as far as it makes sense, there's no difference in API for one
> usage or another.

Of course, I've just mentioned it's initial intention

> But the thing is that default changed.  It were defaulting to /var/lib/lxc
> before.  It wasn't a config per se, or at least not the original config.

LXCPATH still defaults to /var/lib/lxc. Furthermore - patch for changing
it not yet applied

> Now, provided no -f option is given (as it used to be in 0.6.3), it either
> does not read anything (without this your patch), or reads /etc/lxc/something.
> In neither case any old setup works.

Yes, and that's what i'm trying to fix (to make everyone happy) =)

>   1) drop /var/lib/lxc/ entirely
>    1a) and provide some tool that will move configs from that dir to /etc/lxc
>    1b) and warn user that his setup is now broken and that he should inspect
>     and move things manually, provided that his _original_ configs were not
>     in /etc/lxc/ already and so on.

Read archives, that was already suggested. Currently you may apply
simple patch and change LXCPATH whatever you want. I hope, that it was
just forgotten to be applied and it will make it's way to git really
soon.

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? =)

> 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? =)

> 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) ;)

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

P.S. I've also noticed that I've used bad style for opening bracket of
check_rcfile - sorry, it's sometimes very hard to broke own habits =)




More information about the lxc-devel mailing list