From nobody Mon Sep 12 07:16:44 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 4MQyZw1r4Tz4bglW; Mon, 12 Sep 2022 07:16:56 +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 4MQyZv0ygvz3Mkn; Mon, 12 Sep 2022 07:16:54 +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 28C7GjdE091560 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 12 Sep 2022 09:16:45 +0200 (CEST) (envelope-from freebsd@oldach.net) Received: (from hmo@localhost) by nuc.oldach.net (8.17.1/8.17.1/hmo04jun22/Submit) id 28C7Gjd2091559; Mon, 12 Sep 2022 09:16:45 +0200 (CEST) (envelope-from freebsd@oldach.net) Message-Id: <202209120716.28C7Gjd2091559@nuc.oldach.net> Subject: Re: git: 3418c14040f2 - stable/13 - libexec/rc: Add var_run rc script In-Reply-To: <202209120041.28C0fEHa096990@gitrepo.freebsd.org> from Cy Schubert at "12 Sep 2022 00:41:14" To: cy@FreeBSD.org (Cy Schubert) Date: Mon, 12 Sep 2022 09:16:44 +0200 (CEST) Cc: 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 09:16:45 +0200 (CEST) for IP:127.0.0.1 DOMAIN:localhost HELO:nuc.oldach.net FROM:freebsd@oldach.net RCPT: X-Rspamd-Queue-Id: 4MQyZv0ygvz3Mkn 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.30 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-0.999]; NEURAL_HAM_SHORT(-1.00)[-0.996]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; FROM_NO_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@FreeBSD.org,dev-commits-src-branches@FreeBSD.org]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; ASN(0.00)[asn:29670, ipnet:2001:67c:1400::/45, country:DE]; RCPT_COUNT_THREE(0.00)[4]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[oldach.net]; TO_DN_NONE(0.00)[]; RCVD_TLS_LAST(0.00)[] X-ThisMailContainsUnwantedMimeParts: N 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. Kind regards Helge