Date: Sat, 27 Jan 2024 18:01:44 -0500 From: Lowell Gilbert <freebsd-questions-local@be-well.ilk.org> To: Juan Manuel Palacios <jmpalacios@gmail.com> Cc: John Levine <johnl@iecc.com>, freebsd-questions@freebsd.org Subject: Re: Moving /etc/rc.conf.local to /usr/local/etc/rc.conf Message-ID: <44v87egz3b.fsf@be-well.ilk.org> In-Reply-To: <BE60F62F-CBF8-4C05-BF2D-6DECB753EAC4@gmail.com> (Juan Manuel Palacios's message of "Sat, 27 Jan 2024 15:56:08 -0500") References: <20240106214844.5B9DA7FE2A02@ary.qy> <158D9F44-5633-4B4E-A781-834574F42F67@gmail.com> <73678f67-e49f-365a-da09-5575619d736b@iecc.com> <BE60F62F-CBF8-4C05-BF2D-6DECB753EAC4@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Juan Manuel Palacios <jmpalacios@gmail.com> writes:
> I’ve read through the man page and /etc/defaults/rc.conf, and I still
> can’t figure out how to make rc(8) work with a /usr/local/etc/rc.conf
> file fully out-of-the-box. I did manage to configure each individual
> service that I want to start and customize through individual
> /usr/local/etc/rc.conf.d/$name configuration files, which is great, it
> does accomplish the goal I had of moving as many jail configurations
> as possible to /usr/local/etc; but, provided I’m reading things right,
> and /usr/local/etc/rc.conf is indeed not supported out-of-the-box, I
> wonder what the rationale for that would be, i.e. why support
> out-of-the-box /etc/rc.conf & /etc/rc.conf.local, rather than
> /etc/rc.conf & /usr/local/etc/rc.conf, which seems to be the FreeBSD
> standard used for almost everything else (e.g. /etc/pkg.conf &
> /usr/local/etc/pkg.conf for the pkg tool).
>
> I know you can customize the rc_conf_files variable to hold a value
> with my files of choice, but that in itself implies customizing
> /etc/rc.conf to override rc_conf_files’ default value, which defeats
> the purpose of keeping all customizations to /usr/local/etc.
For most people, it doesn't defeat that purpose. Keeping /etc the same
on all your machines is something plenty of people want to do, but
not putting anything into /etc/rc.conf is not by any means the only (or
even the obvious) way to do that.
It's quite common to have a shared /etc, but very uncommon to need that
to be limited to what an unscripted install would put in out of the
box. If you want this because you're applying a common template to
install a lot of machines, there is a common approach of scripting the
install to add the extra variable (or more) to /etc/rc.conf; they will
be customized, but they will all be customized in the same automated
way. You just change them all to have /usr/local/etc/rc.conf (your
choice of filename) included in ${rc_conf_files}.
That said, I don't see any reason that /etc/defaults/rc.conf couldn't
be modified in the official build to include a file in /usr/local into
${rc_conf_files} if said file exists. Make sure the filename isn't
likely to conflict with anything other people have already used, but
aside from that I don't see any downsides.
Be well.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44v87egz3b.fsf>
