From owner-freebsd-bugs@FreeBSD.ORG Fri Jul 2 05:11:18 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 70E1116A4D0 for ; Fri, 2 Jul 2004 05:11:18 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 53E8943D2D for ; Fri, 2 Jul 2004 05:11:18 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i625APcD089992 for ; Fri, 2 Jul 2004 05:10:25 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i625APE2089991; Fri, 2 Jul 2004 05:10:25 GMT (envelope-from gnats) Resent-Date: Fri, 2 Jul 2004 05:10:25 GMT Resent-Message-Id: <200407020510.i625APE2089991@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Mikhail Teterin Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C1F6C16A4CE for ; Fri, 2 Jul 2004 05:09:31 +0000 (GMT) Received: from aldan.algebra.com (aldan.algebra.com [216.254.65.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6696B43D1F for ; Fri, 2 Jul 2004 05:09:31 +0000 (GMT) (envelope-from mi@aldan.algebra.com) Received: from aldan.algebra.com (mi@localhost [127.0.0.1]) by aldan.algebra.com (8.12.11/8.12.11) with ESMTP id i6258q3s029733 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 2 Jul 2004 01:08:53 -0400 (EDT) (envelope-from mi@aldan.algebra.com) Received: (from mi@localhost) by aldan.algebra.com (8.12.11/8.12.11/Submit) id i6258qgn029732; Fri, 2 Jul 2004 01:08:52 -0400 (EDT) (envelope-from mi) Message-Id: <200407020508.i6258qgn029732@aldan.algebra.com> Date: Fri, 2 Jul 2004 01:08:52 -0400 (EDT) From: Mikhail Teterin To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/68586: [patch] allow to forward to non-default ports on remote hosts X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jul 2004 05:11:18 -0000 >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: