Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Sep 2022 16:05:53 +0200 (CEST)
From:      freebsd@oldach.net (Helge Oldach)
To:        Cy.Schubert@cschubert.com
Cc:        cy@FreeBSD.org, 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:  <202209121405.28CE5r8m053976@nuc.oldach.net>
In-Reply-To: <20220912131715.06DE9171@slippy.cwsent.com> from Cy Schubert at "12 Sep 2022 06:17:14"

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202209121405.28CE5r8m053976>