change nginx process pgid (#2181)

put restarted nginx process in another process group, just like the normal nginx start did in https://github.com/kubernetes/ingress-nginx/blob/master/internal/ingress/controller/nginx.go#L289
This commit is contained in:
Oilbeater 2018-03-08 22:58:54 +08:00 committed by Manuel Alejandro de Brito Fontes
parent 5ba0f4ea18
commit f6b8506b17

View file

@ -320,8 +320,12 @@ func (n *NGINXController) Start() {
process.WaitUntilPortIsAvailable(n.cfg.ListenPorts.HTTP)
// release command resources
cmd.Process.Release()
cmd = exec.Command(n.binary, "-c", cfgPath)
// start a new nginx master process if the controller is not being stopped
cmd = exec.Command(n.binary, "-c", cfgPath)
cmd.SysProcAttr = &syscall.SysProcAttr{
Setpgid: true,
Pgid: 0,
}
n.start(cmd)
}
case event := <-n.updateCh.Out():