From owner-freebsd-questions@freebsd.org Thu Aug 31 16:00:52 2017 Return-Path: Delivered-To: freebsd-questions@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 7B40EE00E8F; Thu, 31 Aug 2017 16:00:52 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [78.47.246.247]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 10EBA820BC; Thu, 31 Aug 2017 16:00:51 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id v7VG0fb0046793 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 31 Aug 2017 18:00:42 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: luzar722@gmail.com Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id v7VG0Wsh005995 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 31 Aug 2017 23:00:32 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: standard locations for port files To: Ernie Luzar , "freebsd-questions@freebsd.org" , "freebsd-ports@freebsd.org" References: <59A82622.4030502@gmail.com> From: Eugene Grosbein Message-ID: <59A8329C.7020205@grosbein.net> Date: Thu, 31 Aug 2017 23:00:28 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <59A82622.4030502@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, LOCAL_FROM, RDNS_NONE autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 1.9 RDNS_NONE Delivered to internal network by a host with no rDNS * 2.6 LOCAL_FROM From my domains X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Aug 2017 16:00:52 -0000 31.08.2017 22:07, Ernie Luzar wrote: > Lets say I have a product that I want to port to Freebsd. > > Were is the standard location for the log file and PID file. > > Would it be in > /usr/local/etc/product/product.log > /usr/local/etc/product/product.pid > > or > > /var/log/product.log > /var/run/product.pid FreeBSD cleans /var/run at boot time, so /var/run/product.pid is guaranteed to not exist when "product" is first started that time. On the other hand, /usr/local/etc/product/product.pid can (and will) exist after unclean system reboot and it can contain a PID of already running another process, so that simple check for double-start would fail. So, use /var/run for PID files to be safe.