]> git.proxmox.com Git - mirror_lxc.git/commitdiff
Make lxc-start-ephemeral use lxc.ephemeral
authorChristian Brauner <christianvanbrauner@gmail.com>
Wed, 30 Sep 2015 12:32:24 +0000 (14:32 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 5 Oct 2015 10:49:03 +0000 (11:49 +0100)
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>
src/lxc/lxc-start-ephemeral.in

index b5aae64e58714f99f0b46a2031999f41016c7a9b..4f7627c07ba305bb31d2506ebe252da1370e00dc 100644 (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()