Skip to content

Commit ed9d298

Browse files
committed
fix noMoveProcess in SetupRootless
Based on the description in commit 63ef557 this was added so that the migrate command does not move the pause process into a separate cgroup. It should however not disable the rejoining of the userns when the pause process join failed. BEcause of this we end up calling migrate without a userns and that then can fail if there are actual contianer it tries to cleanup. Fixes: 63ef557 ("command: migrate doesn't move process to cgroup") Signed-off-by: Paul Holzinger <[email protected]>
1 parent c3f3dd3 commit ed9d298

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pkg/domain/infra/abi/system_linux.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ func (ic *ContainerEngine) SetupRootless(_ context.Context, noMoveProcess bool,
7676
if became {
7777
os.Exit(ret)
7878
}
79-
if noMoveProcess {
80-
return nil
81-
}
8279

8380
// if there is no pid file, try to join existing containers, and create a pause process.
8481
ctrs, err := ic.Libpod.GetRunningContainers()
@@ -95,7 +92,7 @@ func (ic *ContainerEngine) SetupRootless(_ context.Context, noMoveProcess bool,
9592
became, ret, err = rootless.TryJoinFromFilePaths(pausePidPath, paths)
9693
} else {
9794
became, ret, err = rootless.BecomeRootInUserNS(pausePidPath)
98-
if err == nil {
95+
if err == nil && !noMoveProcess {
9996
systemd.MovePauseProcessToScope(pausePidPath)
10097
}
10198
}

0 commit comments

Comments
 (0)