From 791d53a21421fba249156ea3a503e9e04a4912e4 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Wed, 8 May 2019 13:49:07 +0200 Subject: rootless: use a pause process use a pause process to keep the user and mount namespace alive. The pause process is created immediately on reload, and all successive Podman processes will refer to it for joining the user&mount namespace. This solves all the race conditions we had on joining the correct namespaces using the conmon processes. As a fallback if the join fails for any reason (e.g. the pause process was killed), then we try to join the running containers as we were doing before. Signed-off-by: Giuseppe Scrivano --- libpod/runtime.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libpod') diff --git a/libpod/runtime.go b/libpod/runtime.go index f9b34e315..def7ba639 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -892,7 +892,11 @@ func makeRuntime(ctx context.Context, runtime *Runtime) (err error) { // we will need to access the storage. if os.Geteuid() != 0 { aliveLock.Unlock() - became, ret, err := rootless.BecomeRootInUserNS() + pausePid, err := util.GetRootlessPauseProcessPidPath() + if err != nil { + return errors.Wrapf(err, "could not get pause process pid file path") + } + became, ret, err := rootless.BecomeRootInUserNS(pausePid) if err != nil { return err } -- cgit v1.2.3-54-g00ecf