fix: Postfix service should proxy signals received#3118
Merged
polarathene merged 1 commit intomasterfrom Feb 26, 2023
Merged
Conversation
`postfix start-fg` was not properly responding to signals received to stop. This caused `supervisorctl restart postfix` and `supervisor stop postfix` to not work as expected (_stopping the Postfix master process, before attempting to start the service again_). Supervisor does not support custom commands for restarting or stopping a service, relying only on managing the process via a signal. In the past we used a wrapper script to TRAP the signals and trigger commands that way. However there is a feature which allows us to proxy signals to a different process by referencing a PID file. As Postfix master process creates a pid file when started, we can avoid a wrapper script and the `supervisorctl` functionality works as intended 👍
casperklein
approved these changes
Feb 26, 2023
Member
Author
|
We probably should have the process tests check that Presently we kill them to check that they restart, and this worked for Postfix because the actual Master process was killed directly, not the |
Member
|
Very nice solution! ❤️ |
georglauterbach
added a commit
that referenced
this pull request
Feb 28, 2023
This commit also includes the removal of files as mentioned in #3118 (see #3116 (comment)). This is a cleanup measure. The old socket file is the primary focus of this commit (and its assocated PR), but I figured this would be _the_ chance to incorporate the removal of the other, unneeded files in order to not open yet another PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
postfix start-fgwas not properly responding to signals received to stop. This causedsupervisorctl restart postfixandsupervisor stop postfixto not work as expected (stopping the Postfix master process, before attempting to start the service again).Supervisor does not support custom commands for restarting or stopping a service, relying only on managing the process via a signal. In the past we used a wrapper script to TRAP the signals and trigger commands that way.
However there is a feature which allows us to proxy signals to a different process by referencing a PID file. As Postfix master process creates a pid file when started, we can avoid a wrapper script and the
supervisorctlfunctionality works as intended 👍Fixes #3116
This is a fix to a change scheduled for upcoming v12: #3033
Type of change