bin/68586: [patch] allow to forward to non-default ports on remote hosts

Mikhail Teterin mi at
Thu Jul 1 22:11:18 PDT 2004

>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
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 02 05:10:25 GMT 2004
>Originator:     Mikhail Teterin
>Release:        FreeBSD 5.2-CURRENT i386
Virtual Estates, Inc.
System: FreeBSD 5.2-CURRENT FreeBSD 5.2-CURRENT #2: Wed Jun 2 15:00:25 EDT 2004 root at 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:

		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 "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 mailing list