2019-11-14 05:50:42 +05:30
|
|
|
#!/bin/sh
|
2019-12-02 01:42:02 +05:30
|
|
|
# Test FWD between two syslogd, second binds 127.0.0.2:5555
|
2019-11-14 05:50:42 +05:30
|
|
|
set -ex
|
|
|
|
if [ x"${srcdir}" = x ]; then
|
|
|
|
srcdir=.
|
|
|
|
fi
|
|
|
|
. ${srcdir}/test.rc
|
|
|
|
|
2019-11-15 15:37:15 +05:30
|
|
|
MSG="fwd and allow"
|
2019-11-14 05:50:42 +05:30
|
|
|
|
|
|
|
cat <<EOF >${CONFD}/fwd.conf
|
|
|
|
ntp.* @127.0.0.2:${PORT2} ;RFC5424
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cat <<EOF >${CONFD2}/50-default.conf
|
2021-01-15 14:10:31 +05:30
|
|
|
kern.* /dev/null
|
|
|
|
*.*;kern.none ${LOG2} ;RFC5424
|
2019-11-14 05:50:42 +05:30
|
|
|
EOF
|
|
|
|
|
2019-12-02 01:42:02 +05:30
|
|
|
../src/syslogd -a 127.0.0.2:* -b :${PORT2} -d -F -f ${CONF2} -p ${SOCK2} -m1 &
|
2019-11-14 05:50:42 +05:30
|
|
|
echo "$!" > ${PID2}
|
|
|
|
|
|
|
|
kill -HUP `cat ${PID}`
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
# Enable debug for second syslogd
|
|
|
|
kill -USR1 `cat ${PID2}`
|
|
|
|
|
|
|
|
../src/logger -t fwd -p ntp.notice -u ${SOCK} -m "NTP123" ${MSG}
|
|
|
|
sleep 3
|
|
|
|
grep "fwd - NTP123 - ${MSG}" ${LOG2}
|