From owner-freebsd-ports@freebsd.org Mon Jul 3 21:14:22 2017 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 844B99F03C7 for ; Mon, 3 Jul 2017 21:14:22 +0000 (UTC) (envelope-from cmt@burggraben.net) Received: from smtp.burggraben.net (smtp.burggraben.net [IPv6:2a01:4f8:140:50a2::3:1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "ns.exwg.net", Issuer "Christoph Moench-Tegeder" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 49F54824BD for ; Mon, 3 Jul 2017 21:14:22 +0000 (UTC) (envelope-from cmt@burggraben.net) Received: from localhost (localhost [127.0.0.1]) by smtp.burggraben.net (Postfix) with ESMTP id 8A7FB600099 for ; Mon, 3 Jul 2017 23:14:19 +0200 (CEST) X-Spam-Scanned: by amavisd-new at exwg.net Received: from smtp.burggraben.net ([127.0.0.1]) by localhost (ns.burggraben.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0jpDKfZ-Dy7G for ; Mon, 3 Jul 2017 23:14:19 +0200 (CEST) Received: from elch.exwg.net (elch.exwg.net [IPv6:2001:470:7120:1:922b:34ff:fe56:321]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "elch.exwg.net", Issuer "Christoph Moench-Tegeder" (not verified)) by smtp.burggraben.net (Postfix) with ESMTPS for ; Mon, 3 Jul 2017 23:14:19 +0200 (CEST) Received: by elch.exwg.net (Postfix, from userid 1000) id BD9DB301EC; Mon, 3 Jul 2017 23:14:18 +0200 (CEST) Date: Mon, 3 Jul 2017 23:14:18 +0200 From: Christoph Moench-Tegeder To: freebsd-ports@freebsd.org Subject: Re: Best practice to tail a log and start it as service using rc.d scripts Message-ID: <20170703211418.GA23149@elch.exwg.net> References: <62c231e8-74b0-8515-eb22-4e4edf6ff5e2@fechner.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <62c231e8-74b0-8515-eb22-4e4edf6ff5e2@fechner.net> User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jul 2017 21:14:22 -0000 ## Matthias Fechner (idefix@fechner.net): > That mailtrain can handle bounce message with postfix together it is > necessary to tail the postfix log and pass it to mailtrain, using a > command like this: > tail -F -n +0 /var/log/maillog | nc localhost 5699 - That looks like a bad idea. As Eugene already demonstrated, you can use syslog (not just "our" syslog, all decent syslog daemons have some way to feed the log into a pipe) - and you can also use syslog to get the log to the mailtrain host, in case that's not running on the same host as postfix (or otherwise seperated). That way, your problem would just not exist, and the setup would be much more robust in general. So, if it's possible to hook the mailtrain "receiver" end to syslog, instead of "some" port... Regards, Christoph -- Spare Space