From edeccb678f70da76edf1b767941c467499380565 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Thu, 11 Jun 2020 13:28:02 +0200 Subject: podman: create scope only if --cgroup-manager=systemd drop check for current cgroup ownership if the cgroup manager is not set to systemd. Closes: https://github.com/containers/libpod/issues/4483 Signed-off-by: Giuseppe Scrivano --- pkg/domain/infra/abi/system.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'pkg/domain') diff --git a/pkg/domain/infra/abi/system.go b/pkg/domain/infra/abi/system.go index b91dd513d..33ba58558 100644 --- a/pkg/domain/infra/abi/system.go +++ b/pkg/domain/infra/abi/system.go @@ -72,11 +72,9 @@ func (ic *ContainerEngine) SetupRootless(_ context.Context, cmd *cobra.Command) return err } unitName := fmt.Sprintf("podman-%d.scope", os.Getpid()) - if err := utils.RunUnderSystemdScope(os.Getpid(), "user.slice", unitName); err != nil { - if conf.Engine.CgroupManager == config.SystemdCgroupsManager { + if conf.Engine.CgroupManager == config.SystemdCgroupsManager { + if err := utils.RunUnderSystemdScope(os.Getpid(), "user.slice", unitName); err != nil { logrus.Warnf("Failed to add podman to systemd sandbox cgroup: %v", err) - } else { - logrus.Debugf("Failed to add podman to systemd sandbox cgroup: %v", err) } } } -- cgit v1.2.3-54-g00ecf