From owner-freebsd-stable@freebsd.org Wed Aug 31 23:24:57 2016 Return-Path: Delivered-To: freebsd-stable@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 4F953BC9641; Wed, 31 Aug 2016 23:24:57 +0000 (UTC) (envelope-from rleigh@codelibre.net) Received: from auth.a.painless.aa.net.uk (auth.a.painless.aa.net.uk [90.155.4.51]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C1F1FFA; Wed, 31 Aug 2016 23:24:57 +0000 (UTC) (envelope-from rleigh@codelibre.net) Received: from 7.5.2.1.f.5.e.f.f.f.c.4.4.a.2.6.d.b.d.d.0.6.8.0.0.b.8.0.1.0.0.2.ip6.arpa ([2001:8b0:860:ddbd:62a4:4cff:fe5f:1257]) by a.painless.aa.net.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.77) (envelope-from ) id 1bfEsJ-0000u8-3l; Thu, 01 Sep 2016 00:24:55 +0100 Subject: Re: Ephemeral /var/run and creating port-specific subdir at service startup time To: freebsd-stable@freebsd.org, ports@freebsd.org References: <6eb3915fa7d4a16b286810e3da298f4d@mailbox.ijs.si> From: Roger Leigh Message-ID: <903d9282-a50b-3213-288b-abdc9c6c6948@codelibre.net> Date: Thu, 1 Sep 2016 00:24:53 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <6eb3915fa7d4a16b286810e3da298f4d@mailbox.ijs.si> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2016 23:24:57 -0000 On 01/09/16 00:12, Mark Martinec wrote: > I prefer to have a /var/run file system reside on a tmpfs > as its contents is small and ephemeral in its nature (like > pid files, lock files, sockets), need not be preserved across > reboots, and should not have to depend on any physical disk. > > The problem is that some programs/services/ports like to create > their own subdirectory under /var/run. This works fine if such > subdirectory is created (when missing) by their rc.d script, > such as salt, dbus, jenkins, clamav-clamd, isc-dhcpd, kibana. > > Unfortunately there are other ports which create a subdirectory > under /var/run at the installation time (pkg install). In this > case their subdirectory is missing on a reboot when /var/run > is re-created afresh, and they fail to start. > > So my question is: are such ports (like influxdb, grafana3) > which do not create their subdirectory at a startup time > in error and a bug report is warranted, or am I wrong in > expecting that /var/run may be ephemeral and is such a setup > (as is common in Linux) unsupported? I can't speak for FreeBSD policies, but as the person who implemented /run on Debian GNU/Linux for sysvinit (/var/run on tmpfs essentially), we had to audit every package and ensure that all packages created the directories they needed if they weren't present. We retained the cleaning of /var/run on boot to ensure a clean slate, so having it on tmpfs was never mandatory, but if you did then it would just work. However, we did have boot-time cleaning of /var/run for a while before we introduced the tmpfs, so I can't recall doing anything but a handful of minor tweaks. Doing the same for FreeBSD wouldn't be too hard if you can automatically scan the ports tree or build package contents to identify and fix any packages which are providing static files. Regards, Roger