svn commit: r349256 - head/libexec/rc/rc.d

Rodney W. Grimes freebsd at gndrsh.dnsmgr.net
Sat Jun 22 00:41:35 UTC 2019


> On 21 Jun, Xin LI wrote:
> 
> > But ultimately, I think the real design question here that needs to be
> > solved would probably be "Why are piling up multiple layers of workarounds
> > around motd? Does it even need to be located in /etc?"  The contents is
> > meant to be updated every time when there is a kernel change, and to that
> > extent it seems to be more appropriate for /var/run and generated at boot
> > from a template located somewhere in /etc.  The benefit of this approach is
> > that you would have one less file to merge for each etcupdate/mergemaster
> > (or at least only need to do it when some customization is made), and there
> > is no need to worry about write durability.
> 
> +1
> 
> This is something that has bothered me for a long time.  It should be
> possible to run with a read-only /etc (obviously with some functional
> limitations).

The updating of the kernel string in /etc/motd is what should go,
that was done before the days of uname, so was more important,
but now it is rather pointless to have the kernel name and
version in motd.

Just go back to earlier days and leave motd as it was intended,
the Message of The Day from the system administrator(s).

If you want readonly / you do:
cd /etc
mkdir ../var/etc
mv motd ../var/etc
ln -s ../var/etc/motd

If your head hurts from the .. it is from decades of me doing chrooted
stuff, sorry, just how my brain fires.  You need to do the above
to a fistfull of other files too, and iirc there are some issues
with passwd as it unlinks the symlinks.  For simpler readonly /
you do:
cd /
mv etc var
ln -s var/etc
this one works very well and is what I use in my nfs diskless setups
to share a readonly / as each node has its own /var file system, /
and /usr are shared.  /tmp varies depending on what i am doing, but
most often a tmpfs.

I do not use the standard freebsd diskless /var tar ball, my /var's
are persistant accross reboots and are per node.

-- 
Rod Grimes                                                 rgrimes at freebsd.org


More information about the svn-src-head mailing list