mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-03 00:56:22 +00:00
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:
parent
4f64d0db3f
commit
7111ed68cb
@ -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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user