mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-15 13:47:41 +00:00
hooks: drop namespace references before post-stop
Callers such as LXD run post-stop hooks to perform cleanup operations on shutdown. This can involve umount and other things. To avoid surprises with lingering namespace references we should close all our namespace-preserving file descriptors. We don't need them at this point anymore anyway. Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
b5bd9e1172
commit
048493a307
@ -1026,6 +1026,9 @@ void lxc_fini(const char *name, struct lxc_handler *handler)
|
||||
lxc_set_state(name, handler, STOPPED);
|
||||
}
|
||||
|
||||
/* Avoid lingering namespace references. */
|
||||
lxc_put_nsfds(handler);
|
||||
|
||||
ret = run_lxc_hooks(name, "post-stop", handler->conf, NULL);
|
||||
if (ret < 0) {
|
||||
ERROR("Failed to run lxc.hook.post-stop for container \"%s\"", name);
|
||||
|
Loading…
Reference in New Issue
Block a user