From owner-freebsd-ports@freebsd.org Mon Jul 3 16:20:41 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 8DAE09E9F2E for ; Mon, 3 Jul 2017 16:20:41 +0000 (UTC) (envelope-from idefix@fechner.net) Received: from anny.lostinspace.de (anny.lostinspace.de [IPv6:2001:608:a02::33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 536F27642E for ; Mon, 3 Jul 2017 16:20:40 +0000 (UTC) (envelope-from idefix@fechner.net) Received: from server.idefix.lan (aftr-185-17-205-73.dynamic.mnet-online.de [185.17.205.73]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: idefix@fechner.net) by anny.lostinspace.de (Postfix) with ESMTPSA id 5BF33C294B2 for ; Mon, 3 Jul 2017 18:20:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=fechner.net; s=default; t=1499098837; bh=RVm0MHVgMK0DEH/xj1QHaCiigIZRlys1ssE3RMAE+QU=; h=To:From:Subject:Date; b=qwCfhD7nN2x38epjq2TH2k3zIjsQFNkzcoVEXJSRNz9CULCc47Hwg9mNoesEPO6dT 6nFFLd93Xp9CFJaxPzLN3L1gUw27x7NKJAd3L1dgz8xyQsxb/ryBYgKofGNOpACmln TRD848BFeLXcqGbqeBDGiBug4y7E2JMoQI7Vavto= Received: from [192.168.0.151] (aftr-185-17-205-73.dynamic.mnet-online.de [185.17.205.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by server.idefix.lan (Postfix) with ESMTPSA id EB934CE155F for ; Mon, 3 Jul 2017 18:20:36 +0200 (CEST) To: FreeBSD Mailing List From: Matthias Fechner Subject: Best practice to tail a log and start it as service using rc.d scripts Message-ID: <62c231e8-74b0-8515-eb22-4e4edf6ff5e2@fechner.net> Date: Mon, 3 Jul 2017 18:20:32 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-US 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 16:20:41 -0000 Dear all, I just in the process to test mailtrain (https://mailtrain.org/) and if it is working I would like to create a port for FreeBSD. 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 - Is there a best practice approach on how to do this on FreeBSD? I would require now a startup script in /usr/local/etc/rc.d to start this kind of tail or is there a better mechanism in FreeBSD available? If not, does anyone have some kind of template/example on how to start a program like tail as daemon so FreeBSD can stop/restart it with the service command? Thanks Matthias --=20 "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." -- Rich Cook