Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Aug 2017 23:00:28 +0700
From:      Eugene Grosbein <eugen@grosbein.net>
To:        Ernie Luzar <luzar722@gmail.com>, "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>, "freebsd-ports@freebsd.org" <freebsd-ports@freebsd.org>
Subject:   Re: standard locations for port files
Message-ID:  <59A8329C.7020205@grosbein.net>
In-Reply-To: <59A82622.4030502@gmail.com>
References:  <59A82622.4030502@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?59A8329C.7020205>