From owner-freebsd-rc@FreeBSD.ORG Fri Jan 13 16:41:33 2012 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 E5BAD106564A; Fri, 13 Jan 2012 16:41:33 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 307D68FC1A; Fri, 13 Jan 2012 16:41:33 +0000 (UTC) Received: by ggki1 with SMTP id i1so2266064ggk.13 for ; Fri, 13 Jan 2012 08:41:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=LFpM0hdMTZ0ST+sQMAufY/mHwtbIyG6soK4G2v9+Css=; b=TpBpFnTqHCxoTWrH4jdquLhoRmMKQz/GhdKev9y8U3afiHwwi2Y4oai72LqtExoZvN Jp6+WyqRLjPVCJl5vIh1uliKS97ly95qqAziowqzvuWv6T0FSB8ymU4TnZGZGZMHo4OQ C8UiXqnI7zi6kMYP9ny48Ny9ybxAl0UVtcGdo= MIME-Version: 1.0 Received: by 10.50.76.225 with SMTP id n1mr1485485igw.11.1326472892655; Fri, 13 Jan 2012 08:41:32 -0800 (PST) Received: by 10.231.207.7 with HTTP; Fri, 13 Jan 2012 08:41:32 -0800 (PST) Received: by 10.231.207.7 with HTTP; Fri, 13 Jan 2012 08:41:32 -0800 (PST) In-Reply-To: <20120113141058.GE1662@garage.freebsd.pl> References: <4F08C95F.6040808@FreeBSD.org> <20120108.081216.1547061187942402256.hrs@allbsd.org> <4F0A22D8.8090206@FreeBSD.org> <20120109.223510.1979757999064039809.hrs@allbsd.org> <4F0FFFF7.4090105@FreeBSD.org> <20120113141058.GE1662@garage.freebsd.pl> Date: Fri, 13 Jan 2012 16:41:32 +0000 Message-ID: From: Chris Rees To: Pawel Jakub Dawidek Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-rc@freebsd.org, Doug Barton Subject: Re: Making use of set_rcvar. X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list 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: Fri, 13 Jan 2012 16:41:34 -0000 On 13 Jan 2012 14:12, "Pawel Jakub Dawidek" wrote: > > On Fri, Jan 13, 2012 at 01:57:11AM -0800, Doug Barton wrote: > > On 01/09/2012 05:35, Hiroki Sato wrote: > > > I prefer to use ${name}_enable because putting the same keyword in > > > two places always leads to a stupid typo issue. > > > > So, here's the thing. I understand what you're saying, I really do. The > > problem is, you're still wrong. :) > > > > There are MANY places where you have to use the value of $name literally > > already, and typos count in every single one of them: > > > > 1. The name of the script file > > 2. PROVIDE > > 3. REQUIRE > > 4. names of service-specific methods, e.g.: start_precmd="foo_prestart" > > 5. Default values in /etc/defaults/rc.conf > > 6. rc.conf.5 > > > > And that's just off the top of my head. The ideal of being able to > > copy/paste example rc.d scripts for use with new services without having > > to change [m]any code sounds great in theory. In practice, search and > > replace is an absolute necessity. So having one more place where you > > have to replace the name of the old service with the new one isn't going > > to hurt anything. > > But if we can avoid it, why not? You gave no argument (valid one) why > using variables is wrose than hardcoding names everywhere. > > > I haven't seen any objection to the _substance_ of my proposal, so I'm > > going to go ahead with it tomorrow. > > Please don't. Touching so many rc.d files is PITA during mergemaster. > If we want to do that, let's do that once. The current consensus as I > see it, is that you are the only one wanting to hardcode names and there > are many in favour of using variables. > Well.... hardcoding IS faster. Chris