diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-05-21 22:08:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-21 22:08:08 +0200 |
commit | 536fd6adddd9693649457441bd4721c3a774ff0b (patch) | |
tree | e4837741f40bc2a6476d6416bfc5566dcd672061 /libpod/runtime.go | |
parent | 8f43d08d966b9519011cb8ca86e2db9f1f18dfcb (diff) | |
parent | 53a76223ee5bded3be3e0ed957517513ad357a0e (diff) | |
download | podman-536fd6adddd9693649457441bd4721c3a774ff0b.tar.gz podman-536fd6adddd9693649457441bd4721c3a774ff0b.tar.bz2 podman-536fd6adddd9693649457441bd4721c3a774ff0b.zip |
Merge pull request #3084 from giuseppe/rootless-pause-process
rootless: use a pause process to keep namespaces alive
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r-- | libpod/runtime.go | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go index 18e9dfeb3..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 } @@ -966,18 +970,6 @@ func makeRuntime(ctx context.Context, runtime *Runtime) (err error) { runtime.valid = true if runtime.doMigrate { - if os.Geteuid() != 0 { - aliveLock.Unlock() - locked = false - - became, ret, err := rootless.BecomeRootInUserNS() - if err != nil { - return err - } - if became { - os.Exit(ret) - } - } if err := runtime.migrate(ctx); err != nil { return err } |