}
if (!ok) {
- LOG(LOGS_WARN, LOGF_Configure, "Line %d in configuration file [%s] contains invalid command",
+ LOG_FATAL(LOGF_Configure, "Line %d in configuration file [%s] contains invalid command",
line_number, filename);
}
n_ntp_sources++;
break;
case CPS_BadOption:
- LOG(LOGS_WARN, LOGF_Configure, "Unrecognized subcommand at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Unrecognized subcommand at line %d", line_number);
break;
case CPS_BadHost:
- LOG(LOGS_WARN, LOGF_Configure, "Invalid host/IP address at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Invalid host/IP address at line %d", line_number);
break;
case CPS_BadPort:
- LOG(LOGS_WARN, LOGF_Configure, "Unreadable port number at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Unreadable port number at line %d", line_number);
break;
case CPS_BadMinpoll:
- LOG(LOGS_WARN, LOGF_Configure, "Unreadable minpoll value at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Unreadable minpoll value at line %d", line_number);
break;
case CPS_BadMaxpoll:
- LOG(LOGS_WARN, LOGF_Configure, "Unreadable maxpoll value at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Unreadable maxpoll value at line %d", line_number);
break;
case CPS_BadPresend:
- LOG(LOGS_WARN, LOGF_Configure, "Unreadable presend value at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Unreadable presend value at line %d", line_number);
break;
case CPS_BadMaxdelaydevratio:
- LOG(LOGS_WARN, LOGF_Configure, "Unreadable max delay dev ratio value at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Unreadable max delay dev ratio value at line %d", line_number);
break;
case CPS_BadMaxdelayratio:
- LOG(LOGS_WARN, LOGF_Configure, "Unreadable max delay ratio value at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Unreadable max delay ratio value at line %d", line_number);
break;
case CPS_BadMaxdelay:
- LOG(LOGS_WARN, LOGF_Configure, "Unreadable max delay value at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Unreadable max delay value at line %d", line_number);
break;
case CPS_BadKey:
- LOG(LOGS_WARN, LOGF_Configure, "Unreadable key value at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Unreadable key value at line %d", line_number);
break;
case CPS_BadMinstratum:
- LOG(LOGS_WARN, LOGF_Configure, "Unreadable minstratum value at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Unreadable minstratum value at line %d", line_number);
break;
case CPS_BadPolltarget:
- LOG(LOGS_WARN, LOGF_Configure, "Unreadable polltarget value at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Unreadable polltarget value at line %d", line_number);
break;
}
parse_sched_priority(const char *line)
{
if (sscanf(line, "%d", &sched_priority) != 1) {
- LOG(LOGS_WARN, LOGF_Configure, "Could not read scheduling priority at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Could not read scheduling priority at line %d", line_number);
}
}
line++;
if (line == tmp) {
- LOG(LOGS_WARN, LOGF_Configure, "Could not read refclock driver name at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Could not read refclock driver name at line %d", line_number);
return;
}
line++;
if (line == tmp) {
- LOG(LOGS_WARN, LOGF_Configure, "Could not read refclock parameter at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Could not read refclock parameter at line %d", line_number);
Free(name);
return;
}
n = 0;
sel_option = SRC_SelectPrefer;
} else {
- LOG(LOGS_WARN, LOGF_Configure, "Unknown refclock parameter %s at line %d", cmd, line_number);
+ LOG_FATAL(LOGF_Configure, "Unknown refclock parameter %s at line %d", cmd, line_number);
break;
}
line += n;
parse_some_port(const char *line, int *portvar)
{
if (sscanf(line, "%d", portvar) != 1) {
- LOG(LOGS_WARN, LOGF_Configure, "Could not read port number at line %d in file", line_number);
+ LOG_FATAL(LOGF_Configure, "Could not read port number at line %d in file", line_number);
}
}
parse_maxupdateskew(const char *line)
{
if (sscanf(line, "%lf", &max_update_skew) != 1) {
- LOG(LOGS_WARN, LOGF_Configure, "Could not read max update skew at line %d in file", line_number);
+ LOG_FATAL(LOGF_Configure, "Could not read max update skew at line %d in file", line_number);
}
}
parse_maxclockerror(const char *line)
{
if (sscanf(line, "%lf", &max_clock_error) != 1) {
- LOG(LOGS_WARN, LOGF_Configure, "Could not read max clock error at line %d in file", line_number);
+ LOG_FATAL(LOGF_Configure, "Could not read max clock error at line %d in file", line_number);
}
}
parse_corrtimeratio(const char *line)
{
if (sscanf(line, "%lf", &correction_time_ratio) != 1) {
- LOG(LOGS_WARN, LOGF_Configure, "Could not read correction time ratio at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Could not read correction time ratio at line %d", line_number);
}
}
parse_reselectdist(const char *line)
{
if (sscanf(line, "%lf", &reselect_distance) != 1) {
- LOG(LOGS_WARN, LOGF_Configure, "Could not read reselect distance at line %d in file", line_number);
+ LOG_FATAL(LOGF_Configure, "Could not read reselect distance at line %d in file", line_number);
}
}
parse_stratumweight(const char *line)
{
if (sscanf(line, "%lf", &stratum_weight) != 1) {
- LOG(LOGS_WARN, LOGF_Configure, "Could not read stratum weight at line %d in file", line_number);
+ LOG_FATAL(LOGF_Configure, "Could not read stratum weight at line %d in file", line_number);
}
}
parse_logbanner(const char *line)
{
if (sscanf(line, "%d", &log_banner) != 1) {
- LOG(LOGS_WARN, LOGF_Configure, "Could not read logbanner number at line %d in file", line_number);
+ LOG_FATAL(LOGF_Configure, "Could not read logbanner number at line %d in file", line_number);
}
}
parse_commandkey(const char *line)
{
if (sscanf(line, "%lu", &command_key_id) != 1) {
- LOG(LOGS_WARN, LOGF_Configure, "Could not read command key ID at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Could not read command key ID at line %d", line_number);
}
}
parse_cmdport(const char *line)
{
if (sscanf(line, "%d", &cmd_port) != 1) {
- LOG(LOGS_WARN, LOGF_Configure, "Could not read command port number at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Could not read command port number at line %d", line_number);
}
}
if (sscanf(p, "%lf%n", &init_slew_threshold, &n) == 1) {
p += n;
} else {
- LOG(LOGS_WARN, LOGF_Configure, "Could not parse initstepslew threshold at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Could not parse initstepslew threshold at line %d", line_number);
return;
}
while (*p) {
parse_clientloglimit(const char *line)
{
if (sscanf(line, "%lu", &client_log_limit) != 1) {
- LOG(LOGS_WARN, LOGF_Configure, "Could not read clientlog memory limit at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Could not read clientlog memory limit at line %d", line_number);
}
if (client_log_limit == 0) {
parse_fallbackdrift(const char *line)
{
if (sscanf(line, "%d %d", &fb_drift_min, &fb_drift_max) != 2) {
- LOG(LOGS_WARN, LOGF_Configure, "Could not read fallback drift intervals at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Could not read fallback drift intervals at line %d", line_number);
}
}
{
if (sscanf(line, "%lf %d", &make_step_threshold, &make_step_limit) != 2) {
make_step_limit = 0;
- LOG(LOGS_WARN, LOGF_Configure,
+ LOG_FATAL(LOGF_Configure,
"Could not read threshold or update limit for stepping clock at line %d\n",
line_number);
}
{
if (sscanf(line, "%lf %d %d", &max_offset, &max_offset_delay, &max_offset_ignore) != 3) {
max_offset_delay = -1;
- LOG(LOGS_WARN, LOGF_Configure,
+ LOG_FATAL(LOGF_Configure,
"Could not read offset, check delay or ignore limit for maximum change at line %d\n",
line_number);
}
do_log_change = 1;
} else {
do_log_change = 0;
- LOG(LOGS_WARN, LOGF_Configure,
+ LOG_FATAL(LOGF_Configure,
"Could not read threshold for logging clock changes at line %d\n",
line_number);
}
strcpy(mail_user_on_change, buffer);
} else {
mail_user_on_change = NULL;
- LOG(LOGS_WARN, LOGF_Configure,
+ LOG_FATAL(LOGF_Configure,
"Could not read user or threshold for clock change mail notify at line %d\n",
line_number);
}
if (n == 1) {
new_node->subnet_bits = specified_subnet_bits;
} else {
- LOG(LOGS_WARN, LOGF_Configure, "Could not read subnet size at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Could not read subnet size at line %d", line_number);
}
}
else
new_node->subnet_bits = 32;
} else {
- LOG(LOGS_WARN, LOGF_Configure, "Could not read address at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Could not read address at line %d", line_number);
}
}
}
else if (ip.family == IPADDR_INET6)
bind_address6 = ip;
} else {
- LOG(LOGS_WARN, LOGF_Configure, "Could not read bind address at line %d\n", line_number);
+ LOG_FATAL(LOGF_Configure, "Could not read bind address at line %d\n", line_number);
}
}
else if (ip.family == IPADDR_INET6)
bind_cmd_address6 = ip;
} else {
- LOG(LOGS_WARN, LOGF_Configure, "Could not read bind command address at line %d\n", line_number);
+ LOG_FATAL(LOGF_Configure, "Could not read bind command address at line %d\n", line_number);
}
}
n = sscanf(line, "%d %50s %d", &interval, addr, &port);
if (n < 2 || !UTI_StringToIP(addr, &ip)) {
- LOG(LOGS_WARN, LOGF_Configure, "Could not parse broadcast directive at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Could not parse broadcast directive at line %d", line_number);
return;
} else if (n == 2) {
/* default port */
port = 123;
} else if (n > 3) {
- LOG(LOGS_WARN, LOGF_Configure, "Too many fields in broadcast directive at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Too many fields in broadcast directive at line %d", line_number);
}
if (max_broadcasts == n_broadcasts) {
line++;
if (line == tmp) {
- LOG(LOGS_WARN, LOGF_Configure, "Could not read tempcomp filename at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Could not read tempcomp filename at line %d", line_number);
return;
}
if (sscanf(line, "%lf %lf %lf %lf %lf", &tempcomp_interval, &tempcomp_T0, &tempcomp_k0, &tempcomp_k1, &tempcomp_k2) != 5) {
- LOG(LOGS_WARN, LOGF_Configure, "Could not read tempcomp interval or coefficients at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Could not read tempcomp interval or coefficients at line %d", line_number);
return;
}
if (1 == sscanf(line, "%d", &linux_hz)) {
set_linux_hz = 1;
} else {
- LOG(LOGS_WARN, LOGF_Configure, "Could not parse linux_hz directive at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Could not parse linux_hz directive at line %d", line_number);
}
}
if (1 == sscanf(line, "%lf", &linux_freq_scale)) {
set_linux_freq_scale = 1;
} else {
- LOG(LOGS_WARN, LOGF_Configure, "Could not parse linux_freq_scale directive at line %d", line_number);
+ LOG_FATAL(LOGF_Configure, "Could not parse linux_freq_scale directive at line %d", line_number);
}
}
for (node = ntp_auth_list.next; node != &ntp_auth_list; node = node->next) {
status = NCR_AddAccessRestriction(&node->ip, node->subnet_bits, node->allow, node->all);
if (!status) {
- LOG(LOGS_WARN, LOGF_Configure, "Bad subnet for %08lx", node->ip);
+ LOG_FATAL(LOGF_Configure, "Bad subnet for %08lx", node->ip);
}
}
for (node = cmd_auth_list.next; node != &cmd_auth_list; node = node->next) {
status = CAM_AddAccessRestriction(&node->ip, node->subnet_bits, node->allow, node->all);
if (!status) {
- LOG(LOGS_WARN, LOGF_Configure, "Bad subnet for %08lx", node->ip);
+ LOG_FATAL(LOGF_Configure, "Bad subnet for %08lx", node->ip);
}
}