From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 06:48:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 386DB106566B; Thu, 12 Jan 2012 06:48:12 +0000 (UTC) (envelope-from rea@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 17F3D8FC08; Thu, 12 Jan 2012 06:48:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0C6mBiD096666; Thu, 12 Jan 2012 06:48:11 GMT (envelope-from rea@svn.freebsd.org) Received: (from rea@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0C6mBio096662; Thu, 12 Jan 2012 06:48:11 GMT (envelope-from rea@svn.freebsd.org) Message-Id: <201201120648.q0C6mBio096662@svn.freebsd.org> From: Eygene Ryabinkin Date: Thu, 12 Jan 2012 06:48:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230007 - in head: etc etc/rc.d share/man/man8 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: Thu, 12 Jan 2012 06:48:12 -0000 Author: rea (ports committer) Date: Thu Jan 12 06:48:11 2012 New Revision: 230007 URL: http://svn.freebsd.org/changeset/base/230007 Log: rc.d: document 'quiet' prefix and fix dhclient/devd interaction Document the current semantics of the 'quiet' command prefix in the rc.subr(8). Fix dhclient rc.d script: it should not call err() for non-DHCP-enabled interface when it is called from devd, because the latter just blindly calls 'service dhclient quietstart' on each "link up" event. Since the 'quietstart' will silence the message "Cannot 'start' . Set _enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'." and running dhclient on the non-DHCP-enabled interface is the same thing as running the service without _enable set, such modification is in sync with the current semantics of the 'quiet' prefix. Approved by: glebius Reviewed by: freebsd-rc list MFC after: 2 weeks Modified: head/etc/rc.d/dhclient head/etc/rc.subr head/share/man/man8/rc.subr.8 Modified: head/etc/rc.d/dhclient ============================================================================== --- head/etc/rc.d/dhclient Thu Jan 12 05:51:11 2012 (r230006) +++ head/etc/rc.d/dhclient Thu Jan 12 06:48:11 2012 (r230007) @@ -22,7 +22,14 @@ stop_precmd="dhclient_pre_check" dhclient_pre_check() { if [ -z "${rc_force}" ] && ! dhcpif $ifn; then - err 1 "'$ifn' is not a DHCP-enabled interface" + local msg + msg="'$ifn' is not a DHCP-enabled interface" + if [ -z "${rc_quiet}" ]; then + err 1 "$msg" + else + debug "$msg" + exit 1 + fi fi } Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Thu Jan 12 05:51:11 2012 (r230006) +++ head/etc/rc.subr Thu Jan 12 06:48:11 2012 (r230007) @@ -1116,7 +1116,7 @@ load_rc_config_var() # rc_usage() { - echo -n 1>&2 "Usage: $0 [fast|force|one](" + echo -n 1>&2 "Usage: $0 [fast|force|one|quiet](" _sep= for _elem; do Modified: head/share/man/man8/rc.subr.8 ============================================================================== --- head/share/man/man8/rc.subr.8 Thu Jan 12 05:51:11 2012 (r230006) +++ head/share/man/man8/rc.subr.8 Thu Jan 12 06:48:11 2012 (r230007) @@ -339,7 +339,7 @@ with being the list of valid arguments prefixed by .Sm off -.Dq Bq Li fast | force | one . +.Dq Bq Li fast | force | one | quiet . .Sm on .It Ic reverse_list Ar item ... Print the list of @@ -427,6 +427,22 @@ Skip the checks for being set to .Dq Li YES , but performs all the other prerequisite tests. +.It Li quiet +Inhibits some verbose diagnostics. +Currently, this includes messages +.Qq Starting ${name} +(as checked by +.Ic check_startmsgs +inside +.Nm ) +and errors about usage of services that are not enabled in +.Xr rc.conf 5 . +This prefix also sets +.Va rc_quiet Ns = Ns Li YES . +.Em Please, note: +.Va rc_quiet +is not intended to completely mask all debug and warning messages, +but only certain small classes of them. .El .Pp .Ic run_rc_command