Re: jail.$jailname.conf not directly in /etc/ ?
- Reply: Jon Clausen : "Re: jail.$jailname.conf not directly in /etc/ ?"
- In reply to: Jon Clausen : "jail.$jailname.conf not directly in /etc/ ?"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 19 Feb 2022 22:54:18 UTC
> ---------------------------------------- > From: Jon Clausen <freebsd-questions@ymmv.dk> > Sent: Sat Feb 19 10:28:24 CET 2022 > To: <freebsd-questions@freebsd.org> > Subject: jail.$jailname.conf not directly in /etc/ ? > ... > I'm trying to keep things segregated from the base system, which basically > just means that I'm putting all of the datasets, config files and whatever > under /usr/local/ somewhere. > > I'm making good progress, and am generally happy with everything except > that I can't find a way to tell the "rc" system to look for the > jail.$jailname.conf files someplace other than /etc/ > > Basically, I think it's sort of messy and and impractical to have a bunch of > individual jail config files laying directly in /etc/. I would prefer to > have them all under, say, /usr/local/etc/jails/ or even /usr/local/etc/. > > But if the files aren't in /etc/, then `service` cannot find them, and jail > start/stop/whatever operations fail. > > I assume that the functionality is there, but the manpages for jail.conf, > rc.conf aren't making it obvious. And from an (admittedly superficial) > glance at /etc/rc.d/jail I don't really see how it would work with a > "global" path for the config files, other than the hardcoded /etc/. > > What I was hoping for would be some global setting in /etc/rc.conf, > /etc/jail.conf or somewhere... > .... Does it not work if you set up local_startup with /usr/local/rc.conf.d/jail as a directory? From rc.conf (5): In addition to /etc/rc.conf.local you can also place smaller configuration files for each rc(8) script in the /etc/rc.conf.d directory or ⟨dir⟩/rc.conf.d directories specified in local_startup, which will be included by the load_rc_config function. For jail configurations you could use the file /etc/rc.conf.d/jail to store jail specific configuration options. If local_startup contains /usr/local/etc/rc.d and /opt/conf, /usr/local/rc.conf.d/jail and /opt/conf/rc.conf.d/jail will be loaded. If ⟨dir⟩/rc.conf.d/⟨name⟩ is a directory, all of files in the directory will be loaded. Also see the rc_conf_files variable below. -- Sent with https://mailfence.com Secure and private email