Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Jan 2024 14:58:11 -0500
From:      Juan Manuel Palacios <jmpalacios@gmail.com>
To:        "freebsd-questions@freebsd.org" <freebsd-questions@FreeBSD.org>
Subject:   Moving /etc/rc.conf.local to /usr/local/etc/rc.conf
Message-ID:  <1C01310F-7F1E-49D8-B480-1BEAA9EFF809@gmail.com>

next in thread | raw e-mail | index | archive | help
Hi everyone,

I=E2=80=99m new on this mailing list (though not to FreeBSD proper), so =
apologies if this question has already been beaten to death, but I =
couldn=E2=80=99t find any discussions on the topic anywhere. I=E2=80=99m =
happy to be pointed to existing answers if they exist, though.

Basically, my question is if it=E2=80=99s possible to use something like =
/usr/local/etc/rc.conf to configure stuff like services that should =
start on system boot, rather than putting that stuff in =
/etc/rc.conf.local (or /etc/rc.conf, for that matter). And the context =
of my question is that lately I=E2=80=99ve been looking for ways to =
simplify my jail management as I move through several of them for =
multiple reasons (major userland upgrades, major application upgrades, =
etc.), and one thing I find myself doing more-and-more is extracting all =
sorts of configuration to mounts, with /urs/local/etc being one of them =
(and turning the jails themselves more-and-more into disposable units).

So, if I have a configs directory mounted onto jail A=E2=80=99s =
/usr/local/etc, and at some point I want to upgrade that jail to its =
successor jail B, moving that same mount to the latter=E2=80=99s =
/usr/local/etc makes upgrading a breeze. The only problem I have is that =
this process fails to capture the configurations made in rc.conf(5).

The best technique I=E2=80=99ve come up with so far to remediate this =
problem is indeed creating a /usr/local/etc/rc.conf file, which I =
configure to my liking, and then symlink=E2=80=99ing /etc/rc.conf.local =
to it. But, other than having to remember to create the symlink in the =
new jail, I keep thinking that there must be a better way that=E2=80=99d =
keep my local configurations fully out of /etc.

So, is there a reason why rc(8) supporting (or me =E2=80=9Cforcing=E2=80=9D=
 it to support via my symlink) a /usr/local/etc/rc.conf file would be a =
bad idea? Or would this be a worthy enhancement to rc(8)?

Thank you in advance for any help!=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1C01310F-7F1E-49D8-B480-1BEAA9EFF809>