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
|
2021-11-22 15:52:04 +05:30
|
|
|
if [ x"${srcdir}" = x ]; then
|
|
|
|
srcdir=.
|
|
|
|
fi
|
2021-11-22 19:46:05 +05:30
|
|
|
. ${srcdir}/lib.sh
|
|
|
|
|
|
|
|
setup
|
2019-11-14 05:50:42 +05:30
|
|
|
|
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
|
2021-07-01 02:30:09 +05:30
|
|
|
kern.* /dev/null
|
|
|
|
ntp.* @127.0.0.2:${PORT2} ;RFC5424
|
2019-11-14 05:50:42 +05:30
|
|
|
EOF
|
|
|
|
|
|
|
|
cat <<EOF >${CONFD2}/50-default.conf
|
2021-01-15 14:10:31 +05:30
|
|
|
kern.* /dev/null
|
2021-07-01 02:30:09 +05:30
|
|
|
*.*;kern.none ${LOG2} ;RFC5424
|
2019-11-14 05:50:42 +05:30
|
|
|
EOF
|
|
|
|
|
2021-07-01 02:30:09 +05:30
|
|
|
../src/syslogd -a 127.0.0.2:* -b :${PORT2} -d -F -f ${CONF2} -p ${SOCK2} -m1 -C ${CACHE2} -P ${PID2} &
|
2019-11-14 05:50:42 +05:30
|
|
|
|
|
|
|
kill -HUP `cat ${PID}`
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
# Enable debug for second syslogd
|
2021-11-22 19:46:05 +05:30
|
|
|
cat ${PID2} >> "$DIR/PIDs"
|
2019-11-14 05:50:42 +05:30
|
|
|
kill -USR1 `cat ${PID2}`
|
|
|
|
|
|
|
|
../src/logger -t fwd -p ntp.notice -u ${SOCK} -m "NTP123" ${MSG}
|
|
|
|
sleep 3
|
2021-11-22 19:46:05 +05:30
|
|
|
grep "fwd - NTP123 - ${MSG}" ${LOG2} || FAIL "Nothing forwarded."
|