From owner-freebsd-stable@FreeBSD.ORG Sun May 8 19:13:42 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55D5D106564A; Sun, 8 May 2011 19:13:42 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id DA2AD8FC0A; Sun, 8 May 2011 19:13:41 +0000 (UTC) Received: by iyj12 with SMTP id 12so5480542iyj.13 for ; Sun, 08 May 2011 12:13:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:date:from:to:cc:subject:message-id :reply-to:mime-version:content-type:content-disposition :x-openpgp-key-id:x-openpgp-key-fingerprint:x-openpgp-key-url; bh=oCS9kbjB84EwxUSOi2uPIJRMOVm/u+Tom1oJo5h3ZwU=; b=B8WQH+jSLbuewH0zcxA7FZGpx+SQ2cTk/xQI4vum+MxGzR3B/97f76cmhugimVK7Fm AqJCom5i/cE9mbT0oAuK3kcnOvfAA5p8PrXybMl2VOIFv3bU9uFGsrERPj3yNnSKrldF Ud+pGWhAjzKycvWd9L04baTt4DciM+yPlxMmQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:reply-to:mime-version :content-type:content-disposition:x-openpgp-key-id :x-openpgp-key-fingerprint:x-openpgp-key-url; b=rh7ZMV1S4wV/a6VCvVzD3SvCx/BpeV6fth0srGhLO+N9m3gs25+It69RQMXsRBvVPj YwCPHRRTjQXgR/RAZ6s+iwAVpi5gvtJ0aSP7B5RzxUohCfO9N76c/+A3UX17geMHKWJF qpJKlmdfqRadTrpFT8TEYoPT01GACC4MZIiW4= Received: by 10.42.134.70 with SMTP id k6mr5286097ict.488.1304882021199; Sun, 08 May 2011 12:13:41 -0700 (PDT) Received: from DataIX.net (adsl-99-190-84-116.dsl.klmzmi.sbcglobal.net [99.190.84.116]) by mx.google.com with ESMTPS id i3sm2297255iby.6.2011.05.08.12.13.39 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 08 May 2011 12:13:40 -0700 (PDT) Sender: "J. Hellenthal" Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.4/8.14.4) with ESMTP id p48JDb5F006840 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 8 May 2011 15:13:37 -0400 (EDT) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.4/8.14.4/Submit) id p48JDagU006839; Sun, 8 May 2011 15:13:36 -0400 (EDT) (envelope-from jhell@DataIX.net) Date: Sun, 8 May 2011 15:13:36 -0400 From: Jason Hellenthal To: freebsd-rc@freebsd.org Message-ID: <20110508191336.GC3527@DataIX.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PEIAKu/WMn1b1Hv9" Content-Disposition: inline X-OpenPGP-Key-Id: 0x89D8547E X-OpenPGP-Key-Fingerprint: 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E X-OpenPGP-Key-URL: http://bit.ly/0x89D8547E 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. X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-rc@freebsd.org List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 19:13:42 -0000 --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--