summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2020-03-30 12:24:06 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2020-03-30 12:24:10 +0200
commitf59c94892832b95d5d912b00dd4416572ece5004 (patch)
tree34512792c520522cee17b45fd5cbe49341958427 /cmd/podman
parent598bb53d46dfc85b8bcc1e3000736106f80de93e (diff)
downloadpodman-f59c94892832b95d5d912b00dd4416572ece5004.tar.gz
podman-f59c94892832b95d5d912b00dd4416572ece5004.tar.bz2
podman-f59c94892832b95d5d912b00dd4416572ece5004.zip
rootless: make cgroup ownership detection not fatal
do not fail if we cannot detect the cgroup ownership. The detection fails when running in a container, since the cgroup showed in /proc/self/cgroup is not accessible, due to the runtime mounting it directly as the cgroup root. Closes: https://github.com/containers/libpod/issues/5488 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/main_local.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/cmd/podman/main_local.go b/cmd/podman/main_local.go
index b03c7de44..23b3f5ae7 100644
--- a/cmd/podman/main_local.go
+++ b/cmd/podman/main_local.go
@@ -174,13 +174,13 @@ func setupRootless(cmd *cobra.Command, args []string) error {
if os.Geteuid() == 0 {
ownsCgroup, err := cgroups.UserOwnsCurrentSystemdCgroup()
if err != nil {
- return err
- }
- conf, err := runtime.GetConfig()
- if err != nil {
- return err
+ logrus.Warnf("Failed to detect the owner for the current cgroup: %v", err)
}
if !ownsCgroup {
+ conf, err := runtime.GetConfig()
+ if err != nil {
+ 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 {