Skip to content
This repository was archived by the owner on May 27, 2019. It is now read-only.

Commit 7e76671

Browse files
fix(nginx) wait for nginx reload to avoid zombies
If a unix process is spawned, the parent process must wait for its pid or the process will become a zombie after exit. This fixes the problem that the "/opt/router/sbin/router" binary leaves behing a defunct nginx process each time the config is reloaded by spawning "nginx -s reload".
1 parent 018b675 commit 7e76671

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

nginx/commands.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ func Reload() error {
3232
if err := cmd.Start(); err != nil {
3333
return err
3434
}
35+
if err := cmd.Wait(); err != nil {
36+
return err
37+
}
3538
log.Println("INFO: nginx reloaded.")
3639
return nil
3740
}

0 commit comments

Comments
 (0)