Skip to content

dnsdist: --config-check returns returncode 0 for non-existing config file #7611

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

Closed
christofchen opened this issue Mar 21, 2019 · 1 comment · Fixed by #12481
Closed

dnsdist: --config-check returns returncode 0 for non-existing config file #7611

christofchen opened this issue Mar 21, 2019 · 1 comment · Fixed by #12481
Labels
Milestone

Comments

@christofchen
Copy link
Contributor

  • Program: dnsdist
  • Issue type: Bug report

Short description

dnsdist returns 0 as result for a config check of an non-existing file.

I understand that an empty or nonexistent config file is syntactically valid for DNSDIST, but this is still a little bit surprising.
My expectation was that explicitly checking a file which cannot be read would result in a non-zero return code.

  • Operating system: CentOS
  • Software version: dnsdist 1.3.3
  • Software source: PowerDNS repository

Steps to reproduce

dnsdist --check --config nonexistentfile; echo $?

Expected behaviour

Expectation: non-zero return code (because of "unable to read configuration from 'nonexistentfile').

Actual behaviour

$ dnsdist --check --config nonexistentfile; echo $?
Unable to read configuration from 'nonexistentfile'
Configuration 'nonexistentfile' OK!
0

Note the ZERO returncode.

@rgacogne rgacogne added this to the dnsdist-1.4.0 milestone Mar 25, 2019
@rgacogne
Copy link
Member

Thank you for reporting this!
This is easy enough to fix (preliminary work in https://github.com/rgacogne/pdns/tree/dnsdist-check-config) but since we use --check-config in our systemd unit file, among other places, I wonder if that might break some setups where the default configuration file does not exist.

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

Successfully merging a pull request may close this issue.

2 participants