From 19115ef5f1b5fa724efa11a1702b141f9203eacb Mon Sep 17 00:00:00 2001 From: Hui Zhu Date: Thu, 23 May 2019 11:47:53 +0800 Subject: [PATCH] kata_proxy: Set Setsid to true when exec kata-proxy There is an issue that ctrl-c stop vmcache server will stop all containers that its VM is created by it. The cause is kata-proxy and vmcache server use same tty, for example: ps -e | grep kata 3617 pts/5 00:00:00 kata-runtime 3636 pts/5 00:00:00 kata-proxy Ctrl-c will send signal to both kata-proxy and vmcache server. Then the containers that its VM is created by this vmcache server will quit with it. Set Setsid to true when exec kata-proxy to handle this issue. Fixes: #1726 Signed-off-by: Hui Zhu --- virtcontainers/kata_proxy.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/virtcontainers/kata_proxy.go b/virtcontainers/kata_proxy.go index 52f3ef045c..e04b4cfff4 100644 --- a/virtcontainers/kata_proxy.go +++ b/virtcontainers/kata_proxy.go @@ -47,6 +47,9 @@ func (p *kataProxy) start(params proxyParams) (int, string, error) { } cmd := exec.Command(args[0], args[1:]...) + cmd.SysProcAttr = &syscall.SysProcAttr{ + Setsid: true, + } if err := cmd.Start(); err != nil { return -1, "", err }