[lxc-devel] [PATCH] lxc-fedrora: New patch for systemd detection and init configuration.

Serge Hallyn serge.hallyn at ubuntu.com
Thu Aug 15 18:07:02 UTC 2013


Quoting Michael H. Warfield (mhw at WittsEnd.com):
> Ok all...
> 
> Satoshi Matsumoto certainly had the right idea and in spotting a bug in
> the lxc-fedora template for systemd detection.  Heart was in the right
> spot but patch was not what we needed.
> 
> I've looked the patch code over for systemd support and init/upstart
> support and modified the logic appropriately.  If /etc/systemd/system
> exists, we'll do the right thing by systemd.  If /etc/rc.sysinit exists,
> we'll do the right thing by init / upstart.  If both are installed,
> we'll trying and accommodate both in case someone is playing games with
> the two (I've done this).
> 
> Patch was trivial, just took more time to actually test it and create
> some containers with it and verify them, than it did to code them.
> 
> Patch below the jump.
> 
> Regards,
> Mike
> -- 
> Michael H. Warfield (AI4NB) | (770) 985-6132 |  mhw at WittsEnd.com
>    /\/\|=mhw=|\/\/          | (678) 463-0932 |  http://www.wittsend.com/mhw/
>    NIC whois: MHW9          | An optimist believes we live in the best of all
>  PGP Key: 0x674627FF        | possible worlds.  A pessimist is sure of it!
> --
> 
> Signed-off-by: Michael H. Warfield <mhw at WittsEnd.com>

Thanks, Michael.

Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>

> 
> ---  
> diff --git a/templates/lxc-fedora.in b/templates/lxc-fedora.in
> index 23728c6..841af16 100644
> --- a/templates/lxc-fedora.in
> +++ b/templates/lxc-fedora.in
> @@ -567,13 +567,20 @@ if [ $? -ne 0 ]; then
>      exit 1
>  fi
>  
> -type /bin/systemd >/dev/null 2>&1
> -if [ $? -ne 0 ]; then
> -    configure_fedora_init
> -else
> +# If the systemd configuration directory exists - set it up for what we need.
> +if [ -d ${rootfs_path}/etc/systemd/system ]
> +then
>      configure_fedora_systemd
>  fi
>  
> +# This configuration (rc.sysinit) is not inconsistent with the systemd stuff
> +# above and may actually coexist on some upgraded systems.  Let's just make
> +# sure that, if it exists, we update this file, even if it's not used...
> +if [ -f ${rootfs_path}/etc/rc.sysinit ]
> +then
> +    configure_fedora_init
> +fi
> +
>  if [ ! -z $clean ]; then
>      clean || exit 1
>      exit 0
> 
> 



> ------------------------------------------------------------------------------
> Get 100% visibility into Java/.NET code with AppDynamics Lite!
> It's a free troubleshooting tool designed for production.
> Get down to code-level detail for bottlenecks, with <2% overhead. 
> Download for free and get started troubleshooting in minutes. 
> http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk

> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel





More information about the lxc-devel mailing list