unbound
unbound copied to clipboard
[FR] can unbound-checkconf be silenced when configuration is valid?
Current behavior
unbound-checkconf reports a valid and error-free configuration as
$ unbound-checkconf
unbound-checkconf: no errors in /usr/local/etc/unbound/unbound.conf
I've experienced several people (sadly, including myself!) who've been misled by the word errors in the output.
Can we (maybe optionally) silence the output?
Describe the desired feature
Ideal to me would be if unbound-checkconf were completely silent in good Unix manner, such as BIND's named-checkconf:
$ named-checkconf
$
In comparison, Knot-DNS issues the following diagnostic:
$ knotc conf-check
Configuration is valid
FWIW, something as trivial as this one line would do the job:
--- smallapp/unbound-checkconf.c
+++ smallapp/unbound-checkconf.c
@@ -981,7 +981,8 @@ checkconf(const char* cfgfile, const char* opt, int final)
check_fwd(cfg);
check_hints(cfg);
check_auth(cfg);
- printf("unbound-checkconf: no errors in %s\n", cfgfile);
+ if (getenv("UNBOUND_CHECKCONF_QUIET") == NULL)
+ printf("unbound-checkconf: no errors in %s\n", cfgfile);
config_delete(cfg);
}
A new flag, for example -q could be introduced for the same effect as in the diff; I am not too fond of environment variables :)
Alternatively, or in addition, the text could also be changed to:
$ unbound-checkconf
unbound-checkconf: Valid configuration in /usr/local/etc/unbound/unbound.conf
Added a -q flag for this but did not alter the current text.