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 <christianvanbrauner@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
Christian Brauner 2015-09-30 14:32:24 +02:00 committed by Stéphane Graber
parent 4f64d0db3f
commit 7111ed68cb

View File

@ -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()