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:
Tonis Tiigi
2016-10-20 15:34:23 -07:00
parent 253426676c
commit f8d146b07d

View File

@ -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 {