Date: Fri, 2 Jul 2004 01:08:52 -0400 (EDT) From: Mikhail Teterin <mi@aldan.algebra.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/68586: [patch] allow to forward to non-default ports on remote hosts Message-ID: <200407020508.i6258qgn029732@aldan.algebra.com> Resent-Message-ID: <200407020510.i625APE2089991@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 68586 >Category: bin >Synopsis: [patch] allow to forward to non-default ports on remote hosts >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Jul 02 05:10:25 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Mikhail Teterin >Release: FreeBSD 5.2-CURRENT i386 >Organization: Virtual Estates, Inc. >Environment: System: FreeBSD aldan.algebra.com 5.2-CURRENT FreeBSD 5.2-CURRENT #2: Wed Jun 2 15:00:25 EDT 2004 root@aldan.algebra.com:/home/obj/oh/src/sys/DEBUG i386 MFCing will be very simple as well. >Description: 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 machine. 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). >How-To-Repeat: Once the patch is applied and recompiled, add the following to your /etc/syslogd.conf: local3.* @localhost:dbbrowse 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 touch /tmp/test.log ./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 >Fix: Get the patch from http://virtual-estates.net/~mi/port-stuff/syslog.patch The hunks affecting manual pages may need another look. >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200407020508.i6258qgn029732>