-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fork syslog-ng into a new process group via bash monitor mode #453
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
Conversation
This prevents SIGINT from a user interrupt from prematurely quitting syslog-ng. See phusion#450
|
@sundbry have you tested this? |
|
@Theaxiom Yes, tried it with ctrl c, and a normal kill with docker stop Using the same logger.py from #447 Kill with ctrl-c Kill with docker stop |
Theaxiom
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍
|
This can be merged after is passes Travis CI. |
|
Nice solution! I had not heard of monitor mode in bash before, but it makes total sense. |
This prevents SIGINT from a user interrupt from prematurely quitting syslog-ng.
Re: Issue #450 and PR #447
From the bash manual:
When an interactive docker tty receives SIGINT, it forwards the signal to all processes in the tty's process group (https://www.cs.ucsb.edu/~almeroth/classes/W99.276/assignment1/signals.html). By forking syslog-ng into it's own process group with bash monitor mode, this prevents the SIGINT sent to the tty from being sent to syslog-ng, and the normal shutdown procedure is then able to shutdown syslog-ng at the appropriate point in the sequence.