summaryrefslogtreecommitdiff
path: root/libpod/container_internal.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-07-15 16:44:56 -0400
committerMatthew Heon <matthew.heon@pm.me>2019-09-10 10:52:37 -0400
commitc2284962c798a11f3c956ee237f27cfd3b0fcb21 (patch)
treea82ff49ee28be13a9a1702506aa7be051fea9fb1 /libpod/container_internal.go
parent16a70490852fdaf3ea5aeea6b2be19dd70fbf1c7 (diff)
downloadpodman-c2284962c798a11f3c956ee237f27cfd3b0fcb21.tar.gz
podman-c2284962c798a11f3c956ee237f27cfd3b0fcb21.tar.bz2
podman-c2284962c798a11f3c956ee237f27cfd3b0fcb21.zip
Add support for launching containers without CGroups
This is mostly used with Systemd, which really wants to manage CGroups itself when managing containers via unit file. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r--libpod/container_internal.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index ffc6c11ee..1ca20a05d 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -1119,6 +1119,10 @@ func (c *Container) stop(timeout uint) error {
// Internal, non-locking function to pause a container
func (c *Container) pause() error {
+ if c.config.NoCgroups {
+ return errors.Wrapf(define.ErrNoCgroups, "cannot pause without using CGroups")
+ }
+
if err := c.ociRuntime.pauseContainer(c); err != nil {
return err
}
@@ -1132,6 +1136,10 @@ func (c *Container) pause() error {
// Internal, non-locking function to unpause a container
func (c *Container) unpause() error {
+ if c.config.NoCgroups {
+ return errors.Wrapf(define.ErrNoCgroups, "cannot unpause without using CGroups")
+ }
+
if err := c.ociRuntime.unpauseContainer(c); err != nil {
return err
}