summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-08-14 17:30:09 +0200
committerGitHub <noreply@github.com>2019-08-14 17:30:09 +0200
commitf5dcb8011df1f8c7dd501e2ee1db9e069135fba9 (patch)
tree2f03cdd63a6a82601b9aa3dc974c17c8da2b4fe0 /libpod
parent4823cf8fcc460f2d4f8707ff603234baff9d452a (diff)
parent9873901469bd5a4e435132cbb65aa6bacf798c2a (diff)
downloadpodman-f5dcb8011df1f8c7dd501e2ee1db9e069135fba9.tar.gz
podman-f5dcb8011df1f8c7dd501e2ee1db9e069135fba9.tar.bz2
podman-f5dcb8011df1f8c7dd501e2ee1db9e069135fba9.zip
Merge pull request #3810 from giuseppe/use-cgroups
pkg/cgroups: use DBUS session when rootless
Diffstat (limited to 'libpod')
-rw-r--r--libpod/util_linux.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/libpod/util_linux.go b/libpod/util_linux.go
index 78cbc75a7..d5c113daf 100644
--- a/libpod/util_linux.go
+++ b/libpod/util_linux.go
@@ -48,6 +48,9 @@ func makeSystemdCgroup(path string) error {
return err
}
+ if rootless.IsRootless() {
+ return controller.CreateSystemdUserUnit(path, rootless.GetRootlessUID())
+ }
return controller.CreateSystemdUnit(path)
}
@@ -57,6 +60,14 @@ func deleteSystemdCgroup(path string) error {
if err != nil {
return err
}
+ if rootless.IsRootless() {
+ conn, err := cgroups.GetUserConnection(rootless.GetRootlessUID())
+ if err != nil {
+ return err
+ }
+ defer conn.Close()
+ return controller.DeleteByPathConn(path, conn)
+ }
return controller.DeleteByPath(path)
}