standard locations for port files

Eugene Grosbein eugen at grosbein.net
Thu Aug 31 16:00:52 UTC 2017


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.



More information about the freebsd-ports mailing list