mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-23 16:20:26 -05:00
start without a config file (all default settings).
git-svn-id: file:///svn/unbound/trunk@953 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
ed224e1d64
commit
94f8dd838c
4 changed files with 13 additions and 3 deletions
|
|
@ -354,8 +354,12 @@ run_daemon(char* cfgfile, int cmdline_verbose, int debug_mode)
|
||||||
/* config stuff */
|
/* config stuff */
|
||||||
if(!(cfg = config_create()))
|
if(!(cfg = config_create()))
|
||||||
fatal_exit("Could not alloc config defaults");
|
fatal_exit("Could not alloc config defaults");
|
||||||
if(!config_read(cfg, cfgfile))
|
if(!config_read(cfg, cfgfile)) {
|
||||||
fatal_exit("Could not read config file: %s", cfgfile);
|
if(errno != ENOENT)
|
||||||
|
fatal_exit("Could not read config file: %s",
|
||||||
|
cfgfile);
|
||||||
|
log_warn("Continuing with default config settings");
|
||||||
|
}
|
||||||
apply_settings(daemon, cfg, cmdline_verbose);
|
apply_settings(daemon, cfg, cmdline_verbose);
|
||||||
|
|
||||||
/* prepare */
|
/* prepare */
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
|
14 February 2008: Wouter
|
||||||
|
- start without a config file (will complain, but start with
|
||||||
|
defaults).
|
||||||
|
|
||||||
13 February 2008: Wouter
|
13 February 2008: Wouter
|
||||||
- 0.9 released.
|
- 0.9 released.
|
||||||
- 1.0 development. Printout ldns version on unbound -h.
|
- 1.0 development. Printout ldns version on unbound -h.
|
||||||
|
|
|
||||||
|
|
@ -357,6 +357,7 @@ config_read(struct config_file* cfg, char* filename)
|
||||||
if(cfg_parser->errors != 0) {
|
if(cfg_parser->errors != 0) {
|
||||||
fprintf(stderr, "read %s failed: %d errors in configuration file\n",
|
fprintf(stderr, "read %s failed: %d errors in configuration file\n",
|
||||||
cfg_parser->filename, cfg_parser->errors);
|
cfg_parser->filename, cfg_parser->errors);
|
||||||
|
errno=EINVAL;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
||||||
|
|
@ -255,7 +255,8 @@ struct config_file* config_create_forlib();
|
||||||
* Read the config file from the specified filename.
|
* Read the config file from the specified filename.
|
||||||
* @param config: where options are stored into, must be freshly created.
|
* @param config: where options are stored into, must be freshly created.
|
||||||
* @param filename: name of configfile. If NULL nothing is done.
|
* @param filename: name of configfile. If NULL nothing is done.
|
||||||
* @return: false on error.
|
* @return: false on error. In that case errno is set, ENOENT means
|
||||||
|
* file not found.
|
||||||
*/
|
*/
|
||||||
int config_read(struct config_file* config, char* filename);
|
int config_read(struct config_file* config, char* filename);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue