Date: Sun, 8 May 2011 15:13:36 -0400 From: Jason Hellenthal <jhell@DataIX.net> To: freebsd-rc@freebsd.org Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org, freebsd-stable@freebsd.org Subject: [RFC][Change-Request] Create usefulness in rc.subr etc/rc.conf.d/*.conf namespace. Message-ID: <20110508191336.GC3527@DataIX.net>
next in thread | raw e-mail | index | archive | help
--PEIAKu/WMn1b1Hv9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable List, - Please reply-to freebsd-rc@freebsd.org Recently I have been going over some changes in the configurations that=20 are possible with the rc subsystem and to my dismay I have found some=20 inconsistencies with in particular the way rc.conf.d directory is=20 processed and the arguments that are supplied to load_rc_config so I have= =20 patched it up... Let me explain: As determined by rc.subr load_rc_config, config's from=20 rc.conf.d are loaded by the scripts $name as an argument to load_rc_config= =20 and thus only the name being parsed is is available to be used in the=20 rc.conf.d directory. Why is this bad ? Its not! but it is inconvenient as= =20 the user has no direct way to know that a variable used by nfsd is also=20 needed by mountd or the same for various other scripts in the rc.d=20 directory. At this time these config's are explained to be available for=20 the user to utilize by rc.conf(5) but yet without much knowledge of the=20 inner workings of the rc subsystem it would be quite the feat to do. The attachment[1] keeps this functionality the same while introducing a=20 more convenient approach for the user to modularize their configuration=20 however they see fit within a couple constraints that work very well.=20 What does it do ?: As stated above, current functionality is undisturbed=20 while allowing the user to create config's by any name they so desire as=20 long as it has an extension of ".conf", also introducing the ability to=20 turn a configuration file off by using chmod(1). You can turn nfsc1.conf off/on by simply chmod [-/+]x etc/rc.conf.d/nfs1.conf Why ? Simple. How many times have you been bitten by disabling something=20 in the rc.conf file and left to discover what you just disabled was also=20 used by another daemon but that daemon is now not starting ? This is a way= =20 to virtualize your configuration allowing you to add multiple _enable=3D=20 lines to different configurations for different roles. For instance=20 rpcbind is used by both samba and nfs*. With this you can add=20 rpcbind_enable to both a configuration for samba and nfs and when you=20 disable one service you know that you have not disabled a dependent for=20 another. This is a small addition that fixes currently broken undesirable aspects=20 of the configuration system that deals with the rc.conf.d directory with a= =20 SysV style init approach that is just as flexible. This should apply=20 cleanly to current and stable/8 & 8.2-RELEASE systems. Once more feedback= =20 has been received Ill update the manual page with any suggestions=20 regenerate the patch to accommodate and file a PR. 1). http://patches.jhell.googlecode.com/hg/rc.subr_modular_conf.patch Thanks --=20 Regards, (jhell) Jason Hellenthal --PEIAKu/WMn1b1Hv9 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) Comment: http://bit.ly/0x89D8547E iQEcBAEBAgAGBQJNxutfAAoJEJBXh4mJ2FR+anYH/jwyA3ifRH5QAivOkYcj3bSD 4jQCZB8FLDT1U7jE9hBk+YprFdkjBi+bDSPrbNYL3cOohvrVuAziB9VG811IhaRE //A9krdIy7QxXdkDFhkmP5F+z0wcmKoriFcO7onsDKVAqGjgyv+YyW+EohLjy283 rUAAmlgmlUSqcdAFNh8mJzNFDtcO9rqcXC1GVIGMY5wqoDLVQdkLwXrlmvPZc9eA Fz3++ZBPq0orRCjQDeP2h+rnAtssgBTXxaZhIM6tyS8aMBbOgl2XSaT5i5w7Soa5 8OButlT1RQ5TinqMt7ebXB07ycabgmFFLIK2JYPKS6Vp+zYOSYKlf9bO2B0dmMk= =zfmQ -----END PGP SIGNATURE----- --PEIAKu/WMn1b1Hv9--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110508191336.GC3527>