Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move embedded haproxy process to a distinct pid group #1136

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,7 @@ RUN mkdir -p /var/empty /etc/haproxy /var/lib/haproxy /var/run/haproxy\

STOPSIGNAL SIGTERM
USER haproxy

# dumb-init reaps the old haproxy process in the embedded, non master-worker mode,
# after receiving SIGUSR1, avoiding it to become a zombie.
ENTRYPOINT ["/usr/bin/dumb-init", "--", "/start.sh"]
1 change: 1 addition & 0 deletions pkg/haproxy/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,7 @@ func (i *instance) startHAProxySync() {
"-f", i.options.HAProxyCfgDir)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
if err := cmd.Start(); err != nil {
i.logger.Error("error starting haproxy: %v", err)
return
Expand Down
3 changes: 3 additions & 0 deletions rootfs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@ RUN mkdir -p /var/empty /etc/haproxy /var/lib/haproxy /var/run/haproxy\

STOPSIGNAL SIGTERM
USER haproxy

# dumb-init reaps the old haproxy process in the embedded, non master-worker mode,
# after receiving SIGUSR1, avoiding it to become a zombie.
ENTRYPOINT ["/usr/bin/dumb-init", "--", "/start.sh"]