summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi/system.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2022-06-17 14:16:21 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2022-06-21 15:50:52 +0200
commitecf225019a6cbb37edc5cc938ba260248d351c89 (patch)
tree0ad236740fba6072f1052b141bdb26f422eb76c0 /pkg/domain/infra/abi/system.go
parent9afd5e31c8e2d6a59868ec834cb1893c24a9c12b (diff)
downloadpodman-ecf225019a6cbb37edc5cc938ba260248d351c89.tar.gz
podman-ecf225019a6cbb37edc5cc938ba260248d351c89.tar.bz2
podman-ecf225019a6cbb37edc5cc938ba260248d351c89.zip
rootless: attempt to join all specified paths
when there are multiple paths specified, attempt to join them all before returning an error. Previously we were failing on the first pid found. [NO NEW TESTS NEEDED] Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'pkg/domain/infra/abi/system.go')
-rw-r--r--pkg/domain/infra/abi/system.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/pkg/domain/infra/abi/system.go b/pkg/domain/infra/abi/system.go
index 820ba529b..6be37c87f 100644
--- a/pkg/domain/infra/abi/system.go
+++ b/pkg/domain/infra/abi/system.go
@@ -125,8 +125,14 @@ func (ic *ContainerEngine) SetupRootless(_ context.Context, noMoveProcess bool)
paths = append(paths, ctr.Config().ConmonPidFile)
}
- became, ret, err = rootless.TryJoinFromFilePaths(pausePidPath, true, paths)
- utils.MovePauseProcessToScope(pausePidPath)
+ if len(paths) > 0 {
+ became, ret, err = rootless.TryJoinFromFilePaths(pausePidPath, true, paths)
+ } else {
+ became, ret, err = rootless.BecomeRootInUserNS(pausePidPath)
+ if err == nil {
+ utils.MovePauseProcessToScope(pausePidPath)
+ }
+ }
if err != nil {
logrus.Error(errors.Wrapf(err, "invalid internal status, try resetting the pause process with %q", os.Args[0]+" system migrate"))
os.Exit(1)