mirror of https://github.com/containers/podman.git
Merge pull request #6569 from giuseppe/create-slice-only-systemd
podman: create scope only if --cgroup-manager=systemd
This commit is contained in:
commit
5f3e64f643
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue