From: Christian Brauner Date: Wed, 30 Sep 2015 12:32:24 +0000 (+0200) Subject: Make lxc-start-ephemeral use lxc.ephemeral X-Git-Tag: lxc-2.0.0.beta1~109 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7111ed68cb5f3a9547db0891fa6f2565f667fb1c;p=thirdparty%2Flxc.git Make lxc-start-ephemeral use lxc.ephemeral 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 Acked-by: Stéphane Graber --- diff --git a/src/lxc/lxc-start-ephemeral.in b/src/lxc/lxc-start-ephemeral.in index b5aae64e5..4f7627c07 100644 --- a/src/lxc/lxc-start-ephemeral.in +++ b/src/lxc/lxc-start-ephemeral.in @@ -305,16 +305,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()