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: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent b5bd9e11
......@@ -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);
......
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