зеркало из https://github.com/microsoft/docker.git
Revert "WIP for setup kmsg"
This reverts commit 80db9a918337c4ae80ffa9a001da13bd24e848c8. Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
Родитель
664fc54e65
Коммит
5f84738ef1
|
@ -43,9 +43,6 @@ func setupNewMountNamespace(rootfs, console string, readonly bool) error {
|
|||
if err := setupPtmx(rootfs, console); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := setupKmsg(rootfs); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := system.Chdir(rootfs); err != nil {
|
||||
return fmt.Errorf("chdir into %s %s", rootfs, err)
|
||||
}
|
||||
|
@ -214,32 +211,3 @@ func remountSys() error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func setupKmsg(rootfs string) error {
|
||||
oldMask := system.Umask(0000)
|
||||
defer system.Umask(oldMask)
|
||||
|
||||
var (
|
||||
source = filepath.Join(rootfs, "dev/kmsg")
|
||||
dest = filepath.Join(rootfs, "proc/kmsg")
|
||||
)
|
||||
|
||||
if err := system.Mkfifo(source, 0600); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
os.Chmod(source, 0600)
|
||||
os.Chown(source, 0, 0)
|
||||
|
||||
if err := system.Mount(source, dest, "bind", syscall.MS_BIND, ""); err != nil {
|
||||
return err
|
||||
}
|
||||
_, err := os.OpenFile(source, syscall.O_RDWR|syscall.O_NDELAY|syscall.O_CLOEXEC, 0)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := syscall.Unlink(source); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче