+3450. [bug] Stop logfileconfig system test spam system logs.
+ [RT #32315]
+
3449. [bug] gen.c: use the pre-processor to construct format
strings so that compiler can perform sanity checks;
check the snprintf results. [RT #17576]
EXTERN const char * ns_g_chrootdir INIT(NULL);
EXTERN isc_boolean_t ns_g_foreground INIT(ISC_FALSE);
EXTERN isc_boolean_t ns_g_logstderr INIT(ISC_FALSE);
+EXTERN isc_boolean_t ns_g_nosyslog INIT(ISC_FALSE);
EXTERN const char * ns_g_defaultsessionkeyfile
INIT(NS_LOCALSTATEDIR "/run/named/"
ns_log_setdefaultcategory(isc_logconfig_t *lcfg) {
isc_result_t result;
- if (! ns_g_logstderr) {
+ if (! ns_g_logstderr && ! ns_g_nosyslog) {
result = isc_log_usechannel(lcfg, "default_syslog",
ISC_LOGCATEGORY_DEFAULT, NULL);
if (result != ISC_R_SUCCESS)
isc_result_totext(result));
} else
(void)isc_stdio_close(fp);
- } else {
- syslog(LOG_ERR, "isc_file_isplainfile '%s' failed: %s",
- dest.file.name, isc_result_totext(result));
- fprintf(stderr, "isc_file_isplainfile '%s' failed: %s",
- dest.file.name, isc_result_totext(result));
+ goto done;
}
+ if (!ns_g_nosyslog)
+ syslog(LOG_ERR, "isc_file_isplainfile '%s' failed: %s",
+ dest.file.name, isc_result_totext(result));
+ fprintf(stderr, "isc_file_isplainfile '%s' failed: %s",
+ dest.file.name, isc_result_totext(result));
}
+ done:
return (result);
}
else if (!strncmp(isc_commandline_argument,
"delay=", 6))
ns_g_delay = atoi(isc_commandline_argument + 6);
+ else if (!strcmp(isc_commandline_argument, "nosyslog"))
+ ns_g_nosyslog = ISC_TRUE;
else
fprintf(stderr, "unknown -T flag '%s\n",
isc_commandline_argument);
SYMFILE="named_sym"
PIDFILE="${THISDIR}/${CONFDIR}/named.pid"
myRNDC="$RNDC -c ${THISDIR}/${CONFDIR}/rndc.conf"
-myNAMED="$NAMED -c ${THISDIR}/${CONFDIR}/named.conf -m record,size,mctx -T clienttest -d 99 -U 4"
+myNAMED="$NAMED -c ${THISDIR}/${CONFDIR}/named.conf -m record,size,mctx -T clienttest -T nosyslog -d 99 -U 4"
# Stop the server and run through a series of tests with various config
# files while controlling the stop/start of the server.
cp $DIRCONF named.conf
echo > named.run
$myRNDC reconfig
- grep "invalid file" named.run > /dev/null 2>&1
+ grep "configuring logging: invalid file" named.run > /dev/null 2>&1
if [ $? -ne 0 ]
then
echo "I: testing directory as file succeeded (UNEXPECTED)"
cp $PIPECONF named.conf
echo > named.run
$myRNDC reconfig
- grep "invalid file" named.run > /dev/null 2>&1
+ grep "configuring logging: invalid file" named.run > /dev/null 2>&1
if [ $? -ne 0 ]
then
echo "I: testing pipe file as log file succeeded (UNEXPECTED)"