chroot: let root be cleaned up by kernel
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com> Upstream-commit: 70dfea63ba2a8a6d8b367420039aeb6a1759c240 Component: engine
This commit is contained in:
@ -62,13 +62,6 @@ func chroot(path string) (err error) {
|
||||
err = errCleanup
|
||||
}
|
||||
}
|
||||
|
||||
if errCleanup := syscall.Unmount("/", syscall.MNT_DETACH); errCleanup != nil {
|
||||
if err == nil {
|
||||
err = fmt.Errorf("error unmounting root: %v", errCleanup)
|
||||
}
|
||||
return
|
||||
}
|
||||
}()
|
||||
|
||||
if err := syscall.PivotRoot(path, pivotDir); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user