From nobody Mon Sep 12 13:17:14 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MR6Zk4KZSz4cTy7; Mon, 12 Sep 2022 13:17:18 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MR6Zk3PrSz3rLw; Mon, 12 Sep 2022 13:17:18 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from shw-obgw-4003a.ext.cloudfilter.net ([10.228.9.183]) by cmsmtp with ESMTP id Xh5RoeiPTS8WrXjJNoB522; Mon, 12 Sep 2022 13:17:17 +0000 Received: from spqr.komquats.com ([70.66.148.124]) by cmsmtp with ESMTPA id XjJLoYPCXvn7BXjJMoGXjl; Mon, 12 Sep 2022 13:17:17 +0000 X-Authority-Analysis: v=2.4 cv=a/cjSGeF c=1 sm=1 tr=0 ts=631f315d a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=xOM3xZuef0cA:10 a=gRS1eiuiAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=Q4hOwKlhmWKigpeJHXAA:9 a=CjuIK1q_8ugA:10 a=udpbrAo2yJH2O6eCpvBn:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 34D769E7; Mon, 12 Sep 2022 06:17:15 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 06DE9171; Mon, 12 Sep 2022 06:17:14 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: freebsd@oldach.net (Helge Oldach) cc: cy@FreeBSD.org (Cy Schubert), src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: Re: git: 3418c14040f2 - stable/13 - libexec/rc: Add var_run rc script In-reply-to: <202209120716.28C7Gjd2091559@nuc.oldach.net> References: <202209120716.28C7Gjd2091559@nuc.oldach.net> Comments: In-reply-to freebsd@oldach.net (Helge Oldach) message dated "Mon, 12 Sep 2022 09:16:44 +0200." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 12 Sep 2022 06:17:14 -0700 Message-Id: <20220912131715.06DE9171@slippy.cwsent.com> X-CMAE-Envelope: MS4xfME8pYnCtV5Sd7tX2KmsM+LA07awNxX9w4U/AW0Z+FuYRwmu7DVyC3ydwY0Bml6jbh7eaVScjIOs7xPuKoNHn05wKOJoaXr1N2uT4cRo71Fw1hJo2vxe yhh04LNobGkUy0P9vGgqXWzY/OhiC7TErhTaAGMLS+XGzcxh+AK6B3qd6lqym2VFMOtjYRJGHJm/xU7OOaWzbSObUSvO64ti+MB2G8ZhBs2uy0VdNkihkB/m ZDKGlb9QT3CW6aknRgG21Is/+CS1xX1eRUoMztfWdyHjwtzreWWovRJFIQu+Rd36WeR4GCRAt70gYbK7tBb/0u4fD6kG/vLmeUZbW2AzEwmrUdOtETaPKsJP qxD39aR5 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Rspamd-Queue-Id: 4MR6Zk3PrSz3rLw X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N In message <202209120716.28C7Gjd2091559@nuc.oldach.net>, Helge Oldach writes: > Cy Schubert wrote on Mon, 12 Sep 2022 02:41:14 +0200 (CEST): > > libexec/rc: Add var_run rc script > > > > Users with a tmpfs /var/run will lose the directory tree state of > > /var/run at reboot. This rc script will optionally (by default) > > capture the state of the directory structure in /var/run prior to > > shutdown and recreate it at system boot. > > > > Alternatively a user can save the state of the /var/run directories > > manually using service var_run save and disable the autosaving of > > /var/run state using the var_run_autosave variable, for those > > paranoid SSD users. > > I'm afraid this logic does not rhyme well with a common scenario: Firing > up a tmpfs based /var by simply booting with a non-writeable /var which > will trigger /etc/rc.d/var to create, mount and populate a tmpfs based > /var. This is the classic diskless scenario. > > The concern is that var_run by default saves the var_run created mtree > on exactly this tmpfs based /var (as /var/db/mtree/BSD.var-run.mtree) so > it will be gone with the next reboot. This will void the var_run logic > for the default case. > > I would suggest to document that tweaking var_run_mtree appropriately is > necessary for such scenarios. > > Furthermore, I propose to consider extending the scope of var_run from > /var/run to the whole of /var, which would be sensible in certain > diskless cases as well. Your scenario is outside of the scope of this change. This change was designed to support those who use a standard /var with a tmpfs /var/run, similar to Red Hat Linux support of /var/run. Regarding diskless scenarios, my experience with SunOS 4.1.3 in a corporate training lab environment (installed by Sun prior to my joining the group), /var was an NFS share. IMO a newly created tmpfs /var used in this scenario is not only outside of the realm of this change but also significantly more complex because many files, not just directories, must be recreated and populated with data. In a sense you're asking for a freshly installed copy of /var with data saved from prior to reboot to be recreated for diskless workstations. Similar to the corporate training lab I maintained decades ago your diskless workstations should use NFS in such a scenario. > > Kind regards > Helge -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0