You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To implement checkpoint/restore containers need to be started with --detach. This is currently missing.
The important part for checkpoint/restore is that --detach does setsid(). Hardcoding setsid() already helped me to be able to checkpoint a container.
diff --git a/crates/libcontainer/src/process/container_intermediate_process.rs b/crates/libcontainer/src/process/container_intermediate_process.rs
index b2a5e0d..a9e1f00 100644
--- a/crates/libcontainer/src/process/container_intermediate_process.rs+++ b/crates/libcontainer/src/process/container_intermediate_process.rs@@ -95,6 +95,8 @@ pub fn container_intermediate_process(
intermediate_sender
.close()
.context("failed to close sender in the intermediate process")?;
+ nix::unistd::setsid()?;+
container_init_process(args, main_sender, init_receiver)
})?;
// Once we fork the container init process, the job for intermediate process
I am not sure that is the right location, but that works for me. Having it done correctly in --detach is probably much better than what I have done.
The text was updated successfully, but these errors were encountered:
We already call setsid(), but only if we allocate a pseudo terminal. Just looking through the runc code i see that they always seem to call setsid regardless of whether --detach is specified or not. Crun does the same.
To implement checkpoint/restore containers need to be started with
--detach
. This is currently missing.The important part for checkpoint/restore is that
--detach
doessetsid()
. Hardcodingsetsid()
already helped me to be able to checkpoint a container.I am not sure that is the right location, but that works for me. Having it done correctly in
--detach
is probably much better than what I have done.The text was updated successfully, but these errors were encountered: