[lxc-devel] [PATCH] Rework init scripts

Stéphane Graber stgraber at ubuntu.com
Wed Sep 24 20:13:48 UTC 2014


On Wed, Sep 24, 2014 at 04:05:33PM -0400, Dwight Engen wrote:
> 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

Thanks, I'll integrate that in my patch when pushing it upstream.

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

+1 on the postun

For lxc-net, at least in Ubuntu we wanted to minimize the potential for
configuration files conflicts on upgrade, which block the upgrade and
require user intervention.
The way to do that was simply to have lxc-net not be part of the package
at all but instead be entirely constructed from the maintainer script
and only have it built that way if it doesn't exist.

Additions to lxc-net won't appear on a system where LXC is already
present, but that's not an issue since the default values are all set in
the lxc-net script, the config file only serves as an override.

Another reason not to have the file be registered as a conffile is that
since the subnet is determined at installation time and so will likely
vary between machines, this will cause a configuration file prompt with
every single package update as even if the user never edited the file
manually, it'll differ from whatever default one we may include in the
package.

>  
> > 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]
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20140924/a22ad4eb/attachment.sig>


More information about the lxc-devel mailing list