Files
KubePi/internal/server/tty_linux.go
2021-09-30 15:53:59 +08:00

18 lines
407 B
Go

// +build linux
package server
func (e *KubePiSerer) startTty() {
cmd := "gotty"
params := []string{"--permit-write", "unshare", "--fork", "--pid", "--mount-proc", "--mount", "bash", "init-kube.sh"}
go func() {
c := exec.Command(cmd, params...)
c.Env = append(c.Env, os.Environ()...)
c.Stdout = os.Stdout
c.Stderr = os.Stderr
if err := c.Run(); err != nil {
e.logger.Error(err)
}
}()
}