Merge pull request #1727 from teawater/vmcache_ctrlc

Fix the issue that ctrl-c stop vmcache server will stop all     containers that its VM is created by it
This commit is contained in:
Julio Montes 2019-05-24 07:47:42 -05:00 committed by GitHub
commit 7fdda280cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -63,6 +63,7 @@ func New(ctx context.Context, count uint, b base.FactoryBase) base.FactoryBase {
case <-closed: case <-closed:
c.removeFromVmm(vm) c.removeFromVmm(vm)
vm.Stop() vm.Stop()
vm.Disconnect()
c.wg.Done() c.wg.Done()
return return
} }

View File

@ -47,6 +47,9 @@ func (p *kataProxy) start(params proxyParams) (int, string, error) {
} }
cmd := exec.Command(args[0], args[1:]...) cmd := exec.Command(args[0], args[1:]...)
cmd.SysProcAttr = &syscall.SysProcAttr{
Setsid: true,
}
if err := cmd.Start(); err != nil { if err := cmd.Start(); err != nil {
return -1, "", err return -1, "", err
} }