From owner-svn-src-all@FreeBSD.ORG Sun Apr 17 22:31:36 2011 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 DD6AA106564A; Sun, 17 Apr 2011 22:31:36 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDD1E8FC13; Sun, 17 Apr 2011 22:31:36 +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 p3HMVaNE051669; Sun, 17 Apr 2011 22:31:36 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p3HMVaJd051667; Sun, 17 Apr 2011 22:31:36 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201104172231.p3HMVaJd051667@svn.freebsd.org> From: Doug Barton Date: Sun, 17 Apr 2011 22:31:36 +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: r220760 - head/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: Sun, 17 Apr 2011 22:31:37 -0000 Author: dougb Date: Sun Apr 17 22:31:36 2011 New Revision: 220760 URL: http://svn.freebsd.org/changeset/base/220760 Log: The change in r206686 to allow the stop argument to work for a service that is running even though not _enable'd had an annoying side effect. If the service was already started at boot time by another means when the related script came around again in rcorder it would start again, regardless of _enable, because there was a valid pid. [1] So, split the test into 2 parts, one for (!rcvar && !stop), and one for (stop && !valid_pid). This preserves the behavior from r206686 while preventing the undesired side effect. PR: conf/156427 [1] Submitted by: Eugene Grosbein [1] Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Sun Apr 17 22:26:07 2011 (r220759) +++ head/etc/rc.subr Sun Apr 17 22:31:36 2011 (r220760) @@ -651,7 +651,8 @@ run_rc_command() # checkyesno ${rcvar} # and return if that failed # - if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" -a -z "${rc_pid}" ]; then + if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" -a "$rc_arg" != "stop" ] || + [ -n "${rcvar}" -a "$rc_arg" = "stop" -a -z "${rc_pid}" ]; then if ! checkyesno ${rcvar}; then if [ -n "${rc_quiet}" ]; then return 0