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:
parent
5ba0f4ea18
commit
f6b8506b17
1 changed files with 5 additions and 1 deletions
|
@ -320,8 +320,12 @@ func (n *NGINXController) Start() {
|
||||||
process.WaitUntilPortIsAvailable(n.cfg.ListenPorts.HTTP)
|
process.WaitUntilPortIsAvailable(n.cfg.ListenPorts.HTTP)
|
||||||
// release command resources
|
// release command resources
|
||||||
cmd.Process.Release()
|
cmd.Process.Release()
|
||||||
cmd = exec.Command(n.binary, "-c", cfgPath)
|
|
||||||
// start a new nginx master process if the controller is not being stopped
|
// 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)
|
n.start(cmd)
|
||||||
}
|
}
|
||||||
case event := <-n.updateCh.Out():
|
case event := <-n.updateCh.Out():
|
||||||
|
|
Loading…
Reference in a new issue