1// +build linux 2 3package main 4 5import "github.com/codegangsta/cli" 6 7var pauseCommand = cli.Command{ 8 Name: "pause", 9 Usage: "pause suspends all processes inside the container", 10 ArgsUsage: `<container-id> 11 12Where "<container-id>" is the name for the instance of the container to be 13paused. `, 14 Description: `The pause command suspends all processes in the instance of the container. 15 16Use runc list to identiy instances of containers and their current status.`, 17 Action: func(context *cli.Context) { 18 container, err := getContainer(context) 19 if err != nil { 20 fatal(err) 21 } 22 if err := container.Pause(); err != nil { 23 fatal(err) 24 } 25 }, 26} 27 28var resumeCommand = cli.Command{ 29 Name: "resume", 30 Usage: "resumes all processes that have been previously paused", 31 ArgsUsage: `<container-id> 32 33Where "<container-id>" is the name for the instance of the container to be 34resumed.`, 35 Description: `The resume command resumes all processes in the instance of the container. 36 37Use runc list to identiy instances of containers and their current status.`, 38 Action: func(context *cli.Context) { 39 container, err := getContainer(context) 40 if err != nil { 41 fatal(err) 42 } 43 if err := container.Resume(); err != nil { 44 fatal(err) 45 } 46 }, 47} 48