From nobody Mon Sep 12 14:05:53 2022 X-Original-To: dev-commits-src-branches@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 4MR7h924dvz4cbld; Mon, 12 Sep 2022 14:07:05 +0000 (UTC) (envelope-from freebsd@oldach.net) Received: from nuc.oldach.net (hmo.in-vpn.de [IPv6:2001:67c:1407:60::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "nuc.oldach.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MR7h81LGHz3wKc; Mon, 12 Sep 2022 14:07:03 +0000 (UTC) (envelope-from freebsd@oldach.net) Received: from nuc.oldach.net (localhost [127.0.0.1]) by nuc.oldach.net (8.17.1/8.17.1/hmo04jun22) with ESMTPS id 28CE5r6k053977 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 12 Sep 2022 16:05:53 +0200 (CEST) (envelope-from freebsd@oldach.net) Received: (from hmo@localhost) by nuc.oldach.net (8.17.1/8.17.1/hmo04jun22/Submit) id 28CE5r8m053976; Mon, 12 Sep 2022 16:05:53 +0200 (CEST) (envelope-from freebsd@oldach.net) Message-Id: <202209121405.28CE5r8m053976@nuc.oldach.net> Subject: Re: git: 3418c14040f2 - stable/13 - libexec/rc: Add var_run rc script In-Reply-To: <20220912131715.06DE9171@slippy.cwsent.com> from Cy Schubert at "12 Sep 2022 06:17:14" To: Cy.Schubert@cschubert.com Date: Mon, 12 Sep 2022 16:05:53 +0200 (CEST) Cc: cy@FreeBSD.org, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: freebsd@oldach.net (Helge Oldach) X-No-Archive: Yes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: inspected by milter-greylist-4.6.4 (nuc.oldach.net [0.0.0.0]); Mon, 12 Sep 2022 16:05:53 +0200 (CEST) for IP:127.0.0.1 DOMAIN:localhost HELO:nuc.oldach.net FROM:freebsd@oldach.net RCPT: X-Rspamd-Queue-Id: 4MR7h81LGHz3wKc X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd@oldach.net designates 2001:67c:1407:60::1 as permitted sender) smtp.mailfrom=freebsd@oldach.net X-Spamd-Result: default: False [-3.28 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-0.999]; NEURAL_HAM_SHORT(-0.98)[-0.978]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[dev-commits-src-all@FreeBSD.org,dev-commits-src-branches@FreeBSD.org]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FROM_NO_DN(0.00)[]; R_DKIM_NA(0.00)[]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; ASN(0.00)[asn:29670, ipnet:2001:67c:1400::/45, country:DE]; TO_DN_NONE(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; DMARC_NA(0.00)[oldach.net]; RCVD_COUNT_THREE(0.00)[3]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_TLS_LAST(0.00)[] X-ThisMailContainsUnwantedMimeParts: N Cy Schubert wrote on Mon, 12 Sep 2022 15:17:14 +0200 (CEST): > 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. Indeed. I am trying to widen the scope by considering what /etc/rc.d/var does and put /etc/rc.d/var_run in perspective. With current defaults, var_run will not deliver as expected for the case of a volatile /var. In an abstract sense, /etc/rc.d/var and /etc/rc.d/var_run somewhat contradict. > Regarding diskless scenarios, my experience with SunOS 4.1.3 in a corporate I was more thinking about embedded scenarios where the root fs is readonly for a reason. Kind regards Helge