pause.go 1.2 KB

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