-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for main process to just be sleep() - aka: no cmd #465
Conversation
This adds support for starting a container w/o a cmd - which will mean that it creates the container and then holds on to it forever so the namespaces and cgroups don't go away. Then the user can then do things like `runc exec ...` to run whatever other cmds they need to run. This allows for cases where the container needs to be setup in advance of knowing what cmds will be run. Instead of calling system.Execv to run the cmd we just `select {}`, which sleeps forever. This assumes that we don't need to have the apparmor stuff kick-in because there's no risk of this process doing anything bad from this point on. Is this a safe assumption? If not, we'll need another way to fork/exec+sleep. Signed-off-by: Doug Davis <dug@us.ibm.com>
ping @julz |
On Sun, Jan 10, 2016 at 12:19:42PM -0800, Doug Davis wrote:
I'd rather have the container process exit immediately (instead of
So using “exit immediately” makes (1) easy. Without it, there's not a In ccon v0.2.0+, folks wanting that sort of functionality can use See also the optional-reaper discussion in [8](reaping seems like
|
I think that it is a better idea to leave this out. How different runtimes implement this could differ and lead to different behaviors. Using a simple rootfs with a binary that does this is more portable. |
Also with the create / start / destroy workflow we are investigating it will solve much of your usecase. We can revisit other options if not. |
Yup. With the create/start split we can close this. -Doug Sent from my iPhone
|
I'm not so sure we can close this one. If the split between create/start still requires a main process then we may need the user to run some kind of "sleep" as the main process. But, if there is no "sleep" in the image then they're going to run into a problem. This PR allows them to do a "sleep" w/o requiring an exe in the image to do it. |
runtime: Replace "process is stopped" with "process exits"
This adds support for starting a container w/o a cmd - which will mean that
it creates the container and then holds on to it forever so the namespaces
and cgroups don't go away. Then the user can then do things like
runc exec ...
to run whatever other cmds they need to run.This allows for cases where the container needs to be setup in advance of
knowing what cmds will be run.
Instead of calling system.Execv to run the cmd we just
select {}
, whichsleeps forever.
This assumes that we don't need to have the apparmor stuff kick-in because
there's no risk of this process doing anything bad from this point on.
Is this a safe assumption? If not, we'll need another way to fork/exec+sleep.
Signed-off-by: Doug Davis dug@us.ibm.com