-
Notifications
You must be signed in to change notification settings - Fork 883
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
rec: on rhel and debian install recursor.yml default file, but only for new installs #13935
Conversation
…ig file was found So only if no recursor.conf and no recursor.yml was found. This allows: - new installes to have a default .yml file. - existing .conf install to be untouched - existing .yml installs to be left untouched It remains to be seen how we can acheive something similar for Debian.
Pull Request Test Coverage Report for Build 8340713424Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
@@ -106,6 +106,9 @@ getent passwd pdns-recursor > /dev/null || \ | |||
exit 0 | |||
|
|||
%post | |||
if [ ! -e %{_sysconfdir}/%{name}/recursor.conf -a ! -e %{_sysconfdir}/%{name}/recursor.yml ]; then | |||
cp %{_sysconfdir}/%{name}/recursor.yml-dist %{_sysconfdir}/%{name}/recursor.yml |
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.
The cp
should probably be an install to make sure the perms and owner/group are right.
…install default .yml
@@ -5,6 +5,9 @@ case "$1" in | |||
configure) | |||
addgroup --system pdns | |||
adduser --system --home /var/spool/powerdns --shell /bin/false --ingroup pdns --disabled-password --disabled-login --gecos "PowerDNS" pdns | |||
if [ ! -e /etc/powerdns/recursor.conf -a ! -e /etc/powerdns/recursor.yml ]; then | |||
cp /etc/powerdns/recursor.yml-dist /etc/powerdns/recursor.yml |
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.
- this leaves recursor.yml-dist in /etc/powerdns with possible user confusion
- this doesn't register recursor.yml as a conffile with dpkg (but recursor.yml-dist would be!)
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.
Looking at https://manpages.debian.org/testing/dpkg-dev/deb-conffiles.5.en.html I think we're SOL with this approach and instead must install recursor.yml (at build time).
But that also means migrating old installs!
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.
I see the issues. I'm hesitant to do an automatic conversion of .conf
to .yml
. Though the code almost exists in the form of rec_contol show-yaml
. That one writes the suggested config to stdout.
Need to come up with something clever, but also robust enough to not mess things up.
It is clear that this is not the right approach. I have an idea though which might work, will investigate that soon. |
This should us to work around the packaging issues discussed in PowerDNS#13935. THe idea is that modify the parsing so that .conf files also *may* contain YAML. The search for a config file then becomes: 1. Try read recuror.yml if it exists. If valid, done. If it is invalid punt. 2. Try read recursor.conf as YAML. If it is valid, done. 3. If it is invalid, try to read as old-style. This means that the status of recursor.conf as a config file does not change. This allows us to install a default YAML config into recursor.conf for new installs. Of course we leave recursor.conf (and recursor.yml) alone for existing installs. This is a draft. I will add docs and packaging changes after this is deemed the way to proceed.
This should us to work around the packaging issues discussed in PowerDNS#13935. THe idea is that modify the parsing so that .conf files also *may* contain YAML. The search for a config file then becomes: 1. Try read recuror.yml if it exists. If valid, done. If it is invalid punt. 2. Try read recursor.conf as YAML. If it is valid, done. 3. If it is invalid, try to read as old-style. This means that the status of recursor.conf as a config file does not change. This allows us to install a default YAML config into recursor.conf for new installs. Of course we leave recursor.conf (and recursor.yml) alone for existing installs. This is a draft. I will add docs and packaging changes after this is deemed the way to proceed.
This should us to work around the packaging issues discussed in PowerDNS#13935. THe idea is that modify the parsing so that .conf files also *may* contain YAML. The search for a config file then becomes: 1. Try read recuror.yml if it exists. If valid, done. If it is invalid punt. 2. Try read recursor.conf as YAML. If it is valid, done. 3. If it is invalid, try to read as old-style. This means that the status of recursor.conf as a config file does not change. This allows us to install a default YAML config into recursor.conf for new installs. Of course we leave recursor.conf (and recursor.yml) alone for existing installs. This is a draft. I will add docs and packaging changes after this is deemed the way to proceed.
So only if no existing recursor.conf and no recursor.yml was found. This allows:
This needs careful review from somebody familiar with packaging do's and don't s.
Short description
Checklist
I have: