mirror of
https://github.com/containers/podman.git
synced 2025-06-20 09:03:43 +08:00
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>
This commit is contained in:
@ -72,11 +72,9 @@ func (ic *ContainerEngine) SetupRootless(_ context.Context, cmd *cobra.Command)
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
unitName := fmt.Sprintf("podman-%d.scope", os.Getpid())
|
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)
|
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)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user