From owner-freebsd-rc@FreeBSD.ORG Mon Oct 12 22:01:08 2009 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 EE9E91065692 for ; Mon, 12 Oct 2009 22:01:08 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 9970D8FC18 for ; Mon, 12 Oct 2009 22:01:08 +0000 (UTC) Received: (qmail 8270 invoked by uid 399); 12 Oct 2009 22:01:07 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 12 Oct 2009 22:01:07 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4AD3A722.9060401@FreeBSD.org> Date: Mon, 12 Oct 2009 15:01:06 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 To: Hiroki Sato References: <200910052011.n95KBXdS024044@svn.freebsd.org> In-Reply-To: <200910052011.n95KBXdS024044@svn.freebsd.org> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Mark Murray , freebsd-rc@freebsd.org Subject: Re: svn commit: r197790 - head/etc 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: Mon, 12 Oct 2009 22:01:09 -0000 I think this is the wrong solution to the problem. In at least two cases (routed and route6d) where $command is not defined in the rc.d scripts this change is resulting in $command not being defined at all. If you look at the definition of the + parameter substitution this makes sense: ${parameter:+word} Use Alternate Value. If parameter is unset or null, null is substituted; otherwise, the expansion of word is substituted. I think that what you really wanted to do was: Index: rc.subr =================================================================== --- rc.subr (revision 198000) +++ rc.subr (working copy) @@ -616,7 +616,7 @@ esac eval _override_command=\$${name}_program - command=${command:+${_override_command:-$command}} + command=${_override_command:-$command} _keywords="start stop restart rcvar $extra_commands" rc_pid= That actually makes more sense anyway, at least to me since it allows the user to override the definition of command in rc.conf, which seems consistent with how we override other things. Mark, can you revert the band-aids that I supplied previously and try this instead? Anyone else have a comment on this idea? Doug Hiroki Sato wrote: > Author: hrs > Date: Mon Oct 5 20:11:33 2009 > New Revision: 197790 > URL: http://svn.freebsd.org/changeset/base/197790 > > Log: > Fix a case when both ${name}_program and ${command} are defined. > > Spotted by: Michio "Karl" Jinbo > > Modified: > head/etc/rc.subr > > Modified: head/etc/rc.subr > ============================================================================== > --- head/etc/rc.subr Mon Oct 5 19:56:56 2009 (r197789) > +++ head/etc/rc.subr Mon Oct 5 20:11:33 2009 (r197790) > @@ -602,7 +602,7 @@ run_rc_command() > esac > > eval _override_command=\$${name}_program > - command=${command:-${_override_command}} > + command=${command:+${_override_command:-$command}} > > _keywords="start stop restart rcvar $extra_commands" > rc_pid= > -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/