From owner-svn-src-all@FreeBSD.ORG Sat May 8 22:13:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 131E91065673; Sat, 8 May 2010 22:13:49 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 0276C8FC14; Sat, 8 May 2010 22:13:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o48MDmY1043786; Sat, 8 May 2010 22:13:48 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o48MDmKv043785; Sat, 8 May 2010 22:13:48 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201005082213.o48MDmKv043785@svn.freebsd.org> From: Doug Barton Date: Sat, 8 May 2010 22:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207800 - stable/7/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 May 2010 22:13:49 -0000 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 #