diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2020-06-11 13:28:02 +0200 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2020-06-11 13:28:05 +0200 |
commit | edeccb678f70da76edf1b767941c467499380565 (patch) | |
tree | cac1c27804890cca8e1ee1217ab2205be5659b50 /pkg/domain/infra/abi | |
parent | 7b85d5c6d272da17bcdb9fb266859c3e5ec8fd09 (diff) | |
download | podman-edeccb678f70da76edf1b767941c467499380565.tar.gz podman-edeccb678f70da76edf1b767941c467499380565.tar.bz2 podman-edeccb678f70da76edf1b767941c467499380565.zip |
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 <gscrivan@redhat.com>
Diffstat (limited to 'pkg/domain/infra/abi')
-rw-r--r-- | pkg/domain/infra/abi/system.go | 6 |
1 files changed, 2 insertions, 4 deletions
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) } } } |