mirror of
https://github.com/containers/podman.git
synced 2025-09-06 13:53:22 +00:00
utils: raise warning only on cgroupv2
if it is not running on cgroup v2, print only a debug message since
rootless users cannot create the cgroup.
commit 9c1e27fdd5
introduced the regression.
[NO TESTS NEEDED]
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/containers/podman/v3/libpod/define"
|
||||
"github.com/containers/podman/v3/pkg/cgroups"
|
||||
"github.com/containers/storage/pkg/archive"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
@@ -190,7 +191,11 @@ func moveProcessToScope(pidPath, slice, scope string) error {
|
||||
func MovePauseProcessToScope(pausePidPath string) {
|
||||
err := moveProcessToScope(pausePidPath, "user.slice", "podman-pause.scope")
|
||||
if err != nil {
|
||||
if RunsOnSystemd() {
|
||||
unified, err := cgroups.IsCgroup2UnifiedMode()
|
||||
if err != nil {
|
||||
logrus.Warnf("Failed to detect if running with cgroup unified: %v", err)
|
||||
}
|
||||
if RunsOnSystemd() && unified {
|
||||
logrus.Warnf("Failed to add pause process to systemd sandbox cgroup: %v", err)
|
||||
} else {
|
||||
logrus.Debugf("Failed to add pause process to systemd sandbox cgroup: %v", err)
|
||||
|
Reference in New Issue
Block a user