From owner-freebsd-rc@FreeBSD.ORG Mon Jun 20 09:15:06 2011 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBB0D106566B for ; Mon, 20 Jun 2011 09:15:05 +0000 (UTC) (envelope-from stefan.midjich@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id A9FC68FC13 for ; Mon, 20 Jun 2011 09:15:05 +0000 (UTC) Received: by iwr19 with SMTP id 19so3919404iwr.13 for ; Mon, 20 Jun 2011 02:15:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:reply-to:sender:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=/e1WNcUsCJ2C6N+R8ONLqjjO55mjKJ1j/Rq8ebOQnYU=; b=h7mhaUjQmPm41fibMYcZkPDtsp5xLMPcqHYGEjOWThbZVBKjZrAgWYRPLKAqmcY/kO ZQRaYfSjLzbrWzPBzJtpRiCm6xrDgN4osMBL9guj1SQe6XjO8TPUzhfIAuuDxHhX57ib uG0lSOIaf0EB12LATWy5jl3f4BVConQO97SHA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=ALWJmHkT2gqYwh4zQ+r3HzcvFwvvJZTtP44DiUL1JOyEIzB2E+F6XlfUkAd+lrPN0y yLW1A4csiUuUqO+aYCwuy3zr3E+5RJWyE0vMOaSMlwipCuGENDKAV3+fs6FtKAsTXmCC IALNiNeFzYw9CoxY8PTNcfVhsLE3zIV5CuuI8= MIME-Version: 1.0 Received: by 10.43.58.15 with SMTP id wi15mr6150703icb.411.1308561304881; Mon, 20 Jun 2011 02:15:04 -0700 (PDT) Sender: stefan.midjich@gmail.com Received: by 10.42.177.196 with HTTP; Mon, 20 Jun 2011 02:15:04 -0700 (PDT) In-Reply-To: References: <8373928E-23AF-41D1-83BA-34324C38BB02@exonetric.com> Date: Mon, 20 Jun 2011 11:15:04 +0200 X-Google-Sender-Auth: DlNwkajFR1AVEUz-JVNn7cGSsoM Message-ID: From: Stefan Midjich To: Mark Blackman Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-rc@freebsd.org Subject: Re: Status of /etc/rc.conf.d/servicename feature in rc.subr X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: swehack@gmail.com List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2011 09:15:06 -0000 Actually I have something to add about /etc/rc.conf.d and it's not about the shell code. My purpose to all this was to find a way to configure network interfaces that doesn't require parsing rc.conf. We deploy hundreds of machines using data center management tools so writing functions in these tools for network configuration becomes much easier if you separate the network configuration into their own files. So using /etc/rc.conf.d/network will work, but I would like to go further and suggest the OpenBSD model of using interface.ifname or something similar. One file for each interface that is. 2011/6/20 Stefan Midjich : > Shortly after I posted my e-mail I was talking about this with a > co-worker and realized that I'm using the wrong servicename in > rc.conf.d. Checking the name variable in /etc/rc.d/netif made it all > much more clear. > > And yes I would support the further development of this feature > because I plan on using it in deployment of FreeBSD nodes. > > 2011/6/20 Mark Blackman : >> On 20 Jun 2011, at 09:20, Stefan Midjich wrote: >> >>> I noticed in /etc/rc.subr that the function load_rc_config sources >>> /etc/rc.conf.d/${_name}. This is however undocumented, NetBSD mentions >>> this feature in rc.conf(5) but FreeBSD does not. >>> >>> I have two questions, is this a new undocumented feature, or an old >>> one being phased out? I'm hoping it's a new because I really want this >>> feature. >>> >>> Second question, how do I use it? I've tried to track the ${_name} >>> variable but I can't find anyone calling the parent function >>> load_rc_config_var() where the name variable is set from its first >>> argument. >> >> I've added a file called 'jail' there =A0and /etc/rc.d/jail will then >> pick up configuration data from /etc/rc.conf.d/jail. >> >> I think it's quite a useful feature and would support it's >> continued existence. However I wonder who else might be interested >> in a better referencing method more like a perl hash or YAML files >> for the configuration data. >> >> There's a clear nesting behaviour there built from shell variable >> names that I find a little bit overextended. >> >> - Mark >> > > > > -- > > > Med v=E4nliga h=E4lsningar / With kind regards > > Stefan Midjich > http://swehack.se > --=20 Med v=E4nliga h=E4lsningar / With kind regards Stefan Midjich http://swehack.se