svn commit: r197790 - head/etc

Doug Barton dougb at FreeBSD.org
Mon Oct 12 22:01:09 UTC 2009


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/



More information about the freebsd-rc mailing list