diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-10-09 23:12:10 +0200 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-10-23 09:26:54 +0200 |
commit | 13fe146840c4d9d27fd509189735ce0fc7b944f8 (patch) | |
tree | 0629effbf84992b58d3b35365a67f49200e36696 /cmd/podman/main_local.go | |
parent | d3520de6338dd1bce2dd1d51847e064e5299f63e (diff) | |
download | podman-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.go | 9 |
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 { |