Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Apr 2011 23:44:25 +0000 (UTC)
From:      Doug Barton <dougb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r220958 - stable/8/etc
Message-ID:  <201104222344.p3MNiPJR062723@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dougb
Date: Fri Apr 22 23:44:25 2011
New Revision: 220958
URL: http://svn.freebsd.org/changeset/base/220958

Log:
  MFC r220760:
  
  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.
  
  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.

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

Modified: stable/8/etc/rc.subr
==============================================================================
--- stable/8/etc/rc.subr	Fri Apr 22 23:42:23 2011	(r220957)
+++ stable/8/etc/rc.subr	Fri Apr 22 23:44:25 2011	(r220958)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104222344.p3MNiPJR062723>