From nobody Sat Jan 27 23:01:44 2024 X-Original-To: freebsd-questions@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 4TMqnW73hxz596N6 for ; Sat, 27 Jan 2024 23:01:51 +0000 (UTC) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: from be-well.ilk.org (be-well.ilk.org [23.30.133.173]) by mx1.freebsd.org (Postfix) with ESMTP id 4TMqnW1jxdz4JbK for ; Sat, 27 Jan 2024 23:01:51 +0000 (UTC) (envelope-from freebsd-questions-local@be-well.ilk.org) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=none) header.from=ilk.org; spf=pass (mx1.freebsd.org: domain of freebsd-questions-local@be-well.ilk.org designates 23.30.133.173 as permitted sender) smtp.mailfrom=freebsd-questions-local@be-well.ilk.org Received: from lowell-Ubuntu.lan (lowell-Ubuntu.lan [172.30.250.95]) by be-well.ilk.org (Postfix) with ESMTP id 1963F108AF; Sat, 27 Jan 2024 18:01:45 -0500 (EST) Received: by lowell-Ubuntu.lan (Postfix, from userid 1147) id 01AC91080470; Sat, 27 Jan 2024 18:01:44 -0500 (EST) From: Lowell Gilbert To: Juan Manuel Palacios Cc: John Levine , freebsd-questions@freebsd.org Subject: Re: Moving /etc/rc.conf.local to /usr/local/etc/rc.conf In-Reply-To: (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> Date: Sat, 27 Jan 2024 18:01:44 -0500 Message-ID: <44v87egz3b.fsf@be-well.ilk.org> User-Agent: Gnus/5.13 (Gnus v5.13) List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.69 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.989]; DMARC_POLICY_ALLOW(-0.50)[ilk.org,none]; R_SPF_ALLOW(-0.20)[+a]; MIME_GOOD(-0.10)[text/plain]; RCVD_NO_TLS_LAST(0.10)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; ASN(0.00)[asn:7922, ipnet:23.30.0.0/15, country:US]; MID_RHS_MATCH_FROM(0.00)[]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_COUNT_TWO(0.00)[2]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_THREE(0.00)[3] X-Rspamd-Queue-Id: 4TMqnW1jxdz4JbK Juan Manuel Palacios writes: > I=92ve read through the man page and /etc/defaults/rc.conf, and I still > can=92t 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=92m 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=92 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.