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

Signal handler for SIGUSR1 #249

Merged
merged 1 commit into from
May 17, 2024

Conversation

fredrikekre
Copy link
Contributor

@fredrikekre fredrikekre commented May 17, 2024

This patch adds a signal handler for SIGUSR1 that forwards the signal to nginx telling it to reopen log files. This is necessary after rotating log files, for example. See https://nginx.org/en/docs/control.html#logs. Previously we did something like

docker exec <container_name> /bin/bash -c 'kill -USR1 `pgrep -f "nginx: [m]aster"`'

but support for sending SIGUSR1 directly to the container is a bit nicer IMO.

This patch also adds a section on signal handling under "Advanced Usage" in the documentation.

This patch adds a signal handler for SIGUSR1 that forwards the signal to
nginx telling it to reopen log files. This is necessary after rotating
log files, for example. See https://nginx.org/en/docs/control.html#logs.

This patch also adds a section on signal handling under "Advanced Usage"
in the documentation.
@JonasAlfredsson
Copy link
Owner

This is an excellent pull request, gold star for adding documentation!

I merge this now which will build the latest tag, and I will see if I manage to do a proper release tag this evening or tomorrow :)

@JonasAlfredsson JonasAlfredsson merged commit d3c20ff into JonasAlfredsson:master May 17, 2024
1 check passed
@fredrikekre fredrikekre deleted the fe/sigusr1 branch May 17, 2024 15:14
@fredrikekre fredrikekre restored the fe/sigusr1 branch May 17, 2024 15:14
@fredrikekre fredrikekre deleted the fe/sigusr1 branch May 17, 2024 15:14
@fredrikekre
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants