[lxc-devel] [PATCH 5/5 v2] Add distro config file /etc/lxc/lxc.conf
Dwight Engen
dwight.engen at oracle.com
Thu Oct 18 16:50:02 UTC 2012
On Thu, 18 Oct 2012 10:34:16 -0500
Serge Hallyn <serge.hallyn at canonical.com> wrote:
> Quoting Dwight Engen (dwight.engen at oracle.com):
> > This allows a distro to put the distro specific default network
> > configuration (for example bridge device, link type), or other lxc
> > configuration in the case that -f is not passed by the user to
> > lxc-create, in which case lxc-create will use the distro conf file
> > as the basis for the containers config.
> >
> > Signed-off-by: Dwight Engen <dwight.engen at oracle.com>
>
> Thanks much for doing this, Dwight. I'm pushing this to my github
> tree. I do have one question below (which, if I'm not wrong, would
> only result in a 1-line patch).
>
> Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>
See below for patch. BTW- Are you okay with this being in the config
directory with the autoconf machinery also? I think its kind of icky,
and I can move the autoconf stuff to build-aux if you want.
> > ---
> > Makefile.am | 2 +-
> > config/Makefile.am | 9 +++++++++
> > config/lxc.conf.libvirt | 3 +++
> > config/lxc.conf.ubuntu | 3 +++
> > config/lxc.conf.unknown | 1 +
> > configure.ac | 42
> > +++++++++++++++++++++++++++++++++++++++--- lxc.spec.in
> > | 1 + src/lxc/lxc-create.in | 23 +++++++++--------------
> > 8 files changed, 66 insertions(+), 18 deletions(-)
> > create mode 100644 config/lxc.conf.libvirt
> > create mode 100644 config/lxc.conf.ubuntu
> > create mode 100644 config/lxc.conf.unknown
> >
> > diff --git a/Makefile.am b/Makefile.am
> > index c66ecc6..2f7606f 100644
> > --- a/Makefile.am
> > +++ b/Makefile.am
> > @@ -2,7 +2,7 @@
> >
> > ACLOCAL_AMFLAGS = -I config
> >
> > -SUBDIRS = src templates doc
> > +SUBDIRS = config src templates doc
> > DIST_SUBDIRS = config src templates doc
> > EXTRA_DIST = autogen.sh lxc.spec CONTRIBUTING MAINTAINERS ChangeLog
> >
> > diff --git a/config/Makefile.am b/config/Makefile.am
> > index 783ba73..f9949a7 100644
> > --- a/config/Makefile.am
> > +++ b/config/Makefile.am
> > @@ -1,2 +1,11 @@
> > +configdir = $(sysconfdir)/lxc
> > +config_DATA = lxc.conf
> > +conffile = @LXC_CONFFILE@
> > +
> > +EXTRA_DIST = lxc.conf.ubuntu lxc.conf.libvirt lxc.conf.unknown
> > +
> > +lxc.conf:
> > + cp $(conffile) $@
>
> Should the lxc.conf be deleted at make clean? Else, this probably
> needs to be 'cp -f' or 'make; make clean; make' will fail the last
> make? (haven't tried)
It doesn't fail because cp just overwrites the destination, but you're
right that it should be cleaned. Here is the patch to do that (I did a
separate remove in the distclean case to delineate from the autoconf
files):
-- >8 --
Subject: [PATCH] Clean the lxc.conf file
Signed-off-by: Dwight Engen <dwight.engen at oracle.com>
diff --git a/config/Makefile.am b/config/Makefile.am
index f9949a7..22636d9 100644
--- a/config/Makefile.am
+++ b/config/Makefile.am
@@ -7,5 +7,9 @@ EXTRA_DIST = lxc.conf.ubuntu lxc.conf.libvirt lxc.conf.unknown
lxc.conf:
cp $(conffile) $@
+clean:
+ @$(RM) -f lxc.conf
+
distclean:
+ @$(RM) -f lxc.conf
@$(RM) -f compile config.guess config.sub depcomp install-sh ltmain.sh missing Makefile.in Makefile
More information about the lxc-devel
mailing list