summaryrefslogtreecommitdiff
path: root/cmd/podman/main_local.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2019-10-09 23:12:10 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-10-23 09:26:54 +0200
commit13fe146840c4d9d27fd509189735ce0fc7b944f8 (patch)
tree0629effbf84992b58d3b35365a67f49200e36696 /cmd/podman/main_local.go
parentd3520de6338dd1bce2dd1d51847e064e5299f63e (diff)
downloadpodman-13fe146840c4d9d27fd509189735ce0fc7b944f8.tar.gz
podman-13fe146840c4d9d27fd509189735ce0fc7b944f8.tar.bz2
podman-13fe146840c4d9d27fd509189735ce0fc7b944f8.zip
rootless: detect no system session with --cgroup-manager=systemd
if the cgroup manager is set to systemd, detect if dbus is available, otherwise fallback to --cgroup-manager=cgroupfs. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'cmd/podman/main_local.go')
-rw-r--r--cmd/podman/main_local.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/cmd/podman/main_local.go b/cmd/podman/main_local.go
index bdffb6b1e..202d93b35 100644
--- a/cmd/podman/main_local.go
+++ b/cmd/podman/main_local.go
@@ -174,14 +174,13 @@ func setupRootless(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
-
+ conf, err := runtime.GetConfig()
+ if err != nil {
+ return err
+ }
if !ownsCgroup {
unitName := fmt.Sprintf("podman-%d.scope", os.Getpid())
if err := utils.RunUnderSystemdScope(os.Getpid(), "user.slice", unitName); err != nil {
- conf, err2 := runtime.GetConfig()
- if err2 != nil {
- return err2
- }
if conf.CgroupManager == libpod.SystemdCgroupsManager {
logrus.Warnf("Failed to add podman to systemd sandbox cgroup: %v", err)
} else {