From 0786707cd94b8feffaeb083077eccaf10873e682 Mon Sep 17 00:00:00 2001 From: Justine Olshan Date: Fri, 15 Jun 2018 16:08:20 -0700 Subject: Added code for a pause command for a container process. Like runc, the pause command will pause the processes of the given container. It will set that container's status to "paused." A resume command will be be added to unpause and continue running the process. PiperOrigin-RevId: 200789624 Change-Id: I72a5d7813d90ecfc4d01cc252d6018855016b1ea --- runsc/boot/controller.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'runsc/boot') diff --git a/runsc/boot/controller.go b/runsc/boot/controller.go index 095b0a9b9..564f2d271 100644 --- a/runsc/boot/controller.go +++ b/runsc/boot/controller.go @@ -37,6 +37,9 @@ const ( // container.. ContainerExecute = "containerManager.Execute" + // ContainerPause pauses the container. + ContainerPause = "containerManager.Pause" + // ContainerProcesses is the URPC endpoint for getting the list of // processes running in a container. ContainerProcesses = "containerManager.Processes" @@ -153,6 +156,12 @@ func (cm *containerManager) Checkpoint(o *control.SaveOpts, _ *struct{}) error { return state.Save(o, nil) } +// Pause suspends the process in a container. +func (cm *containerManager) Pause(_, _ *struct{}) error { + cm.k.Pause() + return nil +} + // Wait waits for the init process in the given container. func (cm *containerManager) Wait(cid *string, waitStatus *uint32) error { // TODO: Use the cid and wait on the init process in that -- cgit v1.2.3