Subject: Re: rc.subr don't check rcvar YES except at boot/shutdown
To: None <tech-userlevel@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-userlevel
Date: 02/13/2007 12:46:02
On Tue, 13 Feb 2007, Lubomir Sedlacik wrote:

> Index: rc.subr
> ===================================================================
> RCS file: /cvsroot/src/etc/rc.subr,v
> retrieving revision 1.68
> diff -u -p -r1.68 rc.subr
> --- rc.subr	27 Jan 2007 14:30:26 -0000	1.68
> +++ rc.subr	13 Feb 2007 15:22:37 -0000
> @@ -464,6 +464,10 @@ run_rc_command()
>  					#
>  	if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" ]; then
>  		if ! checkyesno ${rcvar}; then
> +			if [ -z $_run_rc_script ]; then
> +				warn "\$${rcvar} is not enabled - see ${rcvar_manpage}."
> +				warn "Use '${name} onestart' if you really mean it."

s/onestart/one${rc_arg}/

So it won't suggest "onestart" when you want "status".

Also do we want these messages logged?

Maybe instead of warn use echo 1>&2



> +                        fi
>  			return 0
>  		fi
>  	fi
> @@ -704,6 +708,8 @@ $command $rc_flags $command_args"
>  #
>  run_rc_script()
>  {
> +	_run_rc_script=true
> +
>  	_file=$1
>  	_arg=$2
>  	if [ -z "$_file" -o -z "$_arg" ]; then



  Jeremy C. Reed