[master] named -L option for default logfile

3832.	[func]		"named -L <filename>" causes named to send log
			messages to the specified file by default instead
			of to the system log. (Thanks to Tony Finch.)
			[RT #35845]
This commit is contained in:
Evan Hunt
2014-04-29 17:17:03 -07:00
parent 2b78610512
commit 44613d4d86
9 changed files with 136 additions and 12 deletions

View File

@@ -24,10 +24,12 @@ PLAINCONF="${THISDIR}/${CONFDIR}/named.plain"
DIRCONF="${THISDIR}/${CONFDIR}/named.dirconf"
PIPECONF="${THISDIR}/${CONFDIR}/named.pipeconf"
SYMCONF="${THISDIR}/${CONFDIR}/named.symconf"
PLAINCONF="${THISDIR}/${CONFDIR}/named.plainconf"
PLAINFILE="named_log"
DIRFILE="named_dir"
PIPEFILE="named_pipe"
SYMFILE="named_sym"
DLFILE="named_deflog"
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 -T nosyslog -d 99 -U 4"
@@ -227,5 +229,27 @@ else
echo "I: skipping symlink test (unable to create symlink)"
fi
status=0
# Now stop the server again and test the -L option
rm -f $DLFILE
$myRNDC stop
cp $PLAINCONF named.conf
$myNAMED -L $DLFILE > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "I:failed to start $myNAMED"
echo "I:exit status: $status"
exit $status
fi
sleep 1
if [ -f "$DLFILE" ]; then
echo "I: testing default logfile using named -L succeeded"
else
echo "I:testing default logfile using named -L failed"
echo "I:exit status: 1"
exit 1
fi
echo "I:exit status: $status"
exit $status