summaryrefslogtreecommitdiff
path: root/libpod/runtime.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r--libpod/runtime.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go
index 69cc10389..6d279a107 100644
--- a/libpod/runtime.go
+++ b/libpod/runtime.go
@@ -100,6 +100,8 @@ type Runtime struct {
// unused.
doRenumber bool
+ doMigrate bool
+
// valid indicates whether the runtime is ready to use.
// valid is set to true when a runtime is returned from GetRuntime(),
// and remains true until the runtime is shut down (rendering its
@@ -962,6 +964,24 @@ func makeRuntime(runtime *Runtime) (err error) {
// further
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(); err != nil {
+ return err
+ }
+ }
+
return nil
}