Commit 7111ed68 by Christian Brauner Committed by Stéphane Graber

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: 's avatarChristian Brauner <christianvanbrauner@gmail.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent 4f64d0db
...@@ -305,16 +305,8 @@ touch $LXC_DIR/configured ...@@ -305,16 +305,8 @@ touch $LXC_DIR/configured
dest.set_config_item("lxc.hook.pre-mount", dest.set_config_item("lxc.hook.pre-mount",
os.path.join(dest_path, "pre-mount")) os.path.join(dest_path, "pre-mount"))
# Generate post-stop script
if not args.keep_data: if not args.keep_data:
with open(os.path.join(dest_path, "post-stop"), "w+") as fd: dest.set_config_item("lxc.ephemeral", "1")
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.save_config() dest.save_config()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment