[lxc-devel] [PATCH] Rework init scripts

Dwight Engen dwight.engen at oracle.com
Wed Sep 24 20:05:33 UTC 2014


On Wed, 24 Sep 2014 13:17:28 -0400
Stéphane Graber <stgraber at ubuntu.com> wrote:

> I've confirmed that the testsuite on all arches passes fine with that
> change and close inspection of the resulting package looked good too.
> 
> It'd be nice to have someone confirm that make rpm works with that
> change as I don't have an easy way to try that.

Hi Stéphane, make rpm is borken for the sysvinit case without (the
scripts get installed in the wrong place as can be seen with "make
install" since initdir isn't actually set):

diff --git a/config/init/sysvinit/Makefile.am b/config/init/sysvinit/Makefile.am
index d166400..e8b9f4f 100644
--- a/config/init/sysvinit/Makefile.am
+++ b/config/init/sysvinit/Makefile.am
@@ -5,9 +5,9 @@ if INIT_SCRIPT_SYSV
 # directly to the rc directory under the appropriate name.
 
 if HAVE_DEBIAN
-       initdir = "init.d"
+initdir = "init.d"
 else
-       initdir = "rc.d/init.d"
+initdir = "rc.d/init.d"
 endif
 
 install-sysvinit: lxc-containers lxc-net


> There's the issue of sysconfig/lxc-net which I dropped and will need
> some other RPM-specific workaround if the file really needs to exist
> (as shipping a file upstream for the sole purpose of making the rpm
> DB happy isn't something I'm happy with).
 
I have not yet tested that the built rpms actually work, will get to
that in a bit. I don't really like that sysconfig/lxc-net is created in
%post, this really should just be a file that gets installed by make
install. Also, I think there needs to be a %postun that does a userdel
lxc-dnsmasq. I'll send a patch for that too if you agree.
 
> Once this lands, I think we'll be good for alpha-2.
> 
> 
> On Wed, Sep 24, 2014 at 01:05:26PM -0400, Stéphane Graber wrote:
> > From: "Michael H. Warfield" <mhw at WittsEnd.com>
> > 
> > This commit is based on the work of:
> >     Signed-off-by: Michael H. Warfield <mhw at WittsEnd.com>
> > 
> > A generic changelog would be:
> >  - Bring support for lxcbr0 to all distributions
> >  - Share the container startup and network configuration logic
> > across distributions and init systems.
> >  - Have all the init scripts call the helper script.
> >  - Support for the various different distro-specific configuration
> >    locations to configure lxc-net and container startup.
> > 
> > Changes on top of Mike's original version:
> >  - Remove sysconfig/lxc-net as it's apparently only there as a
> >    workaround for an RPM limitation and is breaking Debian systems
> > by including a useless file which will get registered as a package
> > provided conffile in the dpkg database and will therefore cause
> > conffile prompts on upgrades...
> >  - Go with a consistant coding style in the various init scripts.
> >  - Split out the common logic from the sysvinit scripts and ship
> > both in their respective location rather than have them be copies.
> >  - Fix the upstart jobs so they actually work (there's no such
> > thing as libexec on Debian systems).
> > 
> > Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
> > ---
[snip so msg is small enough to not await moderator approval]


More information about the lxc-devel mailing list