const char defaultconfig[] = DEFAULT_CONFIG;
-int Conf_init(const char *conffile)
+void Conf_init(const char *conffile)
{
config_init(&configuration);
if (conffile == NULL)
conffile = defaultconfig;
if (config_read_file(&configuration, conffile) != CONFIG_TRUE) {
- fprintf(stderr, "Error in config file %s: %s at line %d\n", conffile,
- config_error_text(&configuration), config_error_line(&configuration));
- exit(1);
+ Log_fatal("Error in config file %s line %d: %s", conffile,
+ config_error_line(&configuration), config_error_text(&configuration));
}
- return 0;
}
void Conf_deinit()
const char *destination;
} conf_channel_link_t;
-int Conf_init(const char *conffile);
+void Conf_init(const char *conffile);
void Conf_deinit();
const char *getStrConf(param_t param);
}
}
- if (Conf_init(conffile) != 0) {
- fprintf(stderr, "Configuration error\n");
- exit(1);
- }
-
if (!nodaemon) {
Log_init(false);
daemonize();
}
else
Log_init(true);
-
+
+ Conf_init(conffile);
+
signal(SIGCHLD, SIG_IGN); /* ignore child */
signal(SIGTSTP, SIG_IGN); /* ignore tty signals */
signal(SIGTTOU, SIG_IGN);