opencontainers / runc

CLI tool for spawning and running containers according to the OCI specification
https://www.opencontainers.org/
Apache License 2.0
11.87k stars 2.11k forks source link

changes in runc to pause the restored container #2560

Open gitsvm opened 4 years ago

gitsvm commented 4 years ago

I want to pause the restored container as soon as it restores the container without running for even few ms. Not able to get what and where i make changes in runc code. Please help.

cyphar commented 4 years ago

This would probably require some work in CRIU to support it, because the CRIU restore code can't run inside the container if you freeze it. So you would probably need CRIU to pause the process immediately before the process code restarts (probably with SIGSTOP) and then you'd do the freeze in runc and send a SIGCONT signal after the cgroup is frozen.

kolyshkin commented 3 years ago

@avagin PTAL if this is possible at all.

avagin commented 3 years ago

I don't think that we need to play with SIGSTOP here. We can tell CRIU to restore a freezer cgroup into the frozen state.