From 7111ed68cb5f3a9547db0891fa6f2565f667fb1c Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Wed, 30 Sep 2015 14:32:24 +0200 Subject: [PATCH] Make lxc-start-ephemeral use lxc.ephemeral MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- 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 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() -- 2.47.2