[lxc-devel] [PATCH] Make lxc-start-ephemeral use lxc.ephemeral

Serge Hallyn serge.hallyn at ubuntu.com
Wed Sep 30 18:09:49 UTC 2015


Quoting Christian Brauner (christianvanbrauner at gmail.com):
> While lxc-copy is under review let users benefit (reboot survival etc.) from the
> new lxc.ephemeral option already in lxc-start-ephemeral. This way we can remove
> the lxc.hook.post-stop script-
> 
> Signed-off-by: Christian Brauner <christianvanbrauner at gmail.com>
> ---

I'll leave this for Stéphane to review, as I'm especially unfamiliar
with the lxc-start-ephemeral code at this point.

>  src/lxc/lxc-start-ephemeral.in | 10 +---------
>  1 file changed, 1 insertion(+), 9 deletions(-)
> 
> diff --git a/src/lxc/lxc-start-ephemeral.in b/src/lxc/lxc-start-ephemeral.in
> index d2c3904..3b3405c 100644
> --- a/src/lxc/lxc-start-ephemeral.in
> +++ b/src/lxc/lxc-start-ephemeral.in
> @@ -306,16 +306,8 @@ touch $LXC_DIR/configured
>  dest.set_config_item("lxc.hook.pre-mount",
>                       os.path.join(dest_path, "pre-mount"))
>  
> -# Generate post-stop script
>  if not args.keep_data:
> -    with open(os.path.join(dest_path, "post-stop"), "w+") as fd:
> -        os.fchmod(fd.fileno(), 0o755)
> -        fd.write("""#!/bin/sh
> -[ -d "%s" ] && rm -Rf "%s"
> -""" % (dest_path, dest_path))
> -
> -    dest.set_config_item("lxc.hook.post-stop",
> -                         os.path.join(dest_path, "post-stop"))
> +    dest.set_config_item("lxc.ephemeral", "1")
>  
>  dest.save_config()
>  
> -- 
> 2.6.0
> 
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel


More information about the lxc-devel mailing list