-
Notifications
You must be signed in to change notification settings - Fork 42
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
Create PID directory on init start commands #75
Conversation
In both RHEL and Debian
It stops/disables the service on Debian platforms It disables the service on RHEL, no need to stop the recursor in this case because its not launched in the first place. This way we remove only_if ward on the pidfile which was preventing chef to stop/disable the recursor on Ubuntu. It’s also a cleaner solution that leaves to the underlying os to do what’s required
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.
Minor syntax thing here, but I also think we should remove the /var/run
file resource in the pdns_recursor_service resource since that is pushed to the init script.
I'd also consider expanding the one-liner in the init scripts for checking PIDDIR for readability sake.
# or fall back to the default /var/run if not specified there. | ||
PIDDIR=$(awk -F= '/^socket-dir=/ {print $2}' $CONFIG_FILE) | ||
if [ -z "$PIDDIR" ]; then PIDDIR=/var/run; fi | ||
# The binary "pdns_recursor" handles its own pidfile according the following |
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.
Why is this indented?
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.
It was not meant, fixed.
@martinisoft that oneliner came straight from their own pdns recursor code. This is why I think it's better not to expand it. |
@martinisoft removing the |
Ah ok, approved then 👍 |
This PR is related to #74 and its upstream bug on PowerDNS init scripts.
PowerDNS refuses to start if the PID directory does not exist before, this may present problems in a few situations, being the most important after a server reboot.
This PR solves the problem by creating a pid directory on
start
command. It fixes the problem in both RHEL and Debian platforms.Additionaly it improves the way the default recursor installed by the official package is disabled on init systems, by replacing
[:stop, :disable]
command for just:disable
and leaving to the underlying system to do what's necessary for that process. This allows a cleaner syntax on the custom resource and less errors on debian (which was not stopping/disabling) the default recursor process.