mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-18 18:00:41 +01:00
Merge pull request #1901 from PascalWithopf/imudp_address_error
imudp: add error msg when listener wasn't created
This commit is contained in:
commit
87a831d6e1
@ -351,6 +351,10 @@ addListner(instanceConf_t *inst)
|
||||
lcnfLast = newlcnfinfo;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
errmsg.LogError(0, NO_ERRCODE, "imudp: Could not create udp listener,"
|
||||
" ignoring port %s bind-address %s.",
|
||||
port, bindAddr);
|
||||
}
|
||||
|
||||
finalize_it:
|
||||
|
||||
28
tests/imudp_error_msg.sh
Executable file
28
tests/imudp_error_msg.sh
Executable file
@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
# add 2016-11-22 by Pascal Withopf, released under ASL 2.0
|
||||
. $srcdir/diag.sh init
|
||||
. $srcdir/diag.sh generate-conf
|
||||
. $srcdir/diag.sh add-conf '
|
||||
module(load="../plugins/imudp/.libs/imudp")
|
||||
input(type="imudp" port="514" address="128.98.1.12")
|
||||
input(type="imudp" port="514" address="128.98.1.12")
|
||||
|
||||
template(name="outfmt" type="string" string="-%msg%-\n")
|
||||
:syslogtag, contains, "tag" action(type="omfile" template="outfmt"
|
||||
file="rsyslog2.out.log")
|
||||
|
||||
action(type="omfile" template="outfmt" file="rsyslog.out.log")
|
||||
'
|
||||
. $srcdir/diag.sh startup
|
||||
. $srcdir/diag.sh shutdown-when-empty
|
||||
. $srcdir/diag.sh wait-shutdown
|
||||
|
||||
grep "imudp: Could not create udp listener, ignoring port 514 bind-address 128.98.1.12." rsyslog.out.log > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo
|
||||
echo "FAIL: expected error message from missing input file not found. rsyslog.out.log is:"
|
||||
cat rsyslog.out.log
|
||||
. $srcdir/diag.sh error-exit 1
|
||||
fi
|
||||
|
||||
. $srcdir/diag.sh exit
|
||||
Loading…
x
Reference in New Issue
Block a user