bin/68586: [patch] allow to forward to non-default ports on remote
mi at aldan.algebra.com
Thu Jul 1 22:11:18 PDT 2004
>Synopsis: [patch] allow to forward to non-default ports on remote hosts
>Arrival-Date: Fri Jul 02 05:10:25 GMT 2004
>Originator: Mikhail Teterin
>Release: FreeBSD 5.2-CURRENT i386
Virtual Estates, Inc.
System: FreeBSD aldan.algebra.com 5.2-CURRENT FreeBSD 5.2-CURRENT #2: Wed Jun 2 15:00:25 EDT 2004 root at aldan.algebra.com:/home/obj/oh/src/sys/DEBUG i386
MFCing will be very simple as well.
A program may wish to receive certain log messages itself --
without the pipes and without watching the log files. Asking
the syslogd to forward such messages to it seems natural, but
then the program will interfere with the syslogd on its own
The patch extends the syslog.conf syntax to allow the @hostname
destinations to, optionally, be in the form of @hostname:port
where "port" is either decimal port number or services name --
getaddrinfo() accepts either.
To test the functionality, and to add even more flexibility,
the patch also allows the -b option to accepts the :port part
(possibly, _only_ the :port part).
Once the patch is applied and recompiled, add the following
to your /etc/syslogd.conf:
and restart syslogd (be sure, there is no more than one -s
option, or it will refuse to forward anything).
Now -- as a normal user -- start another instance of syslogd:
echo '*.* /tmp/test.log' > /tmp/test.conf
./syslogd -f /tmp/test.conf -d -vv -p \
/tmp/test.sock -b localhost:dbbrowse
Now use logger:
logger -p local3.info "Hello there..."
The main syslogd will forward the string to the other syslogd
instance, which will write it into /tmp/test.log
Get the patch from
The hunks affecting manual pages may need another look.
More information about the freebsd-bugs