svn commit: r207800 - stable/7/etc

Doug Barton dougb at FreeBSD.org
Sat May 8 22:13:49 UTC 2010


Author: dougb
Date: Sat May  8 22:13:48 2010
New Revision: 207800
URL: http://svn.freebsd.org/changeset/base/207800

Log:
  MFC r179870:
  
  Move the check for enabled knobs further down in run_rc_command() so
  that bogus commands cause usage information to be printed instead of
  diagnostics about enabling the knob.
  
  This is a prerequisite for merging r206686.

Modified:
  stable/7/etc/rc.subr
Directory Properties:
  stable/7/etc/   (props changed)

Modified: stable/7/etc/rc.subr
==============================================================================
--- stable/7/etc/rc.subr	Sat May  8 21:42:28 2010	(r207799)
+++ stable/7/etc/rc.subr	Sat May  8 22:13:48 2010	(r207800)
@@ -603,23 +603,26 @@ run_rc_command()
 		fi
 	fi
 
+	eval $_pidcmd			# determine the pid if necessary
+
+	for _elem in $_keywords; do
+		if [ "$_elem" != "$rc_arg" ]; then
+			continue
+		fi
 					# if ${rcvar} is set, and $1 is not
 					# "rcvar", then run
 					#	checkyesno ${rcvar}
 					# and return if that failed
 					#
-	if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" ]; then
-		if ! checkyesno ${rcvar}; then
-			return 0
+		if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" ]; then
+			if ! checkyesno ${rcvar}; then
+				echo -n "Cannot '${rc_arg}' $name. Set ${rcvar} to "
+				echo -n "YES in /etc/rc.conf or use 'one${rc_arg}' "
+				echo "instead of '${rc_arg}'."
+				return 0
+			fi
 		fi
-	fi
-
-	eval $_pidcmd			# determine the pid if necessary
 
-	for _elem in $_keywords; do
-		if [ "$_elem" != "$rc_arg" ]; then
-			continue
-		fi
 					# if there's a custom ${XXX_cmd},
 					# run that instead of the default
 					#


More information about the svn-src-all mailing list