Date: Mon, 12 Sep 2022 09:16:44 +0200 (CEST) From: freebsd@oldach.net (Helge Oldach) To: cy@FreeBSD.org (Cy Schubert) Cc: 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 Message-ID: <202209120716.28C7Gjd2091559@nuc.oldach.net> In-Reply-To: <202209120041.28C0fEHa096990@gitrepo.freebsd.org> from Cy Schubert at "12 Sep 2022 00:41:14"
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202209120716.28C7Gjd2091559>