From nobody@FreeBSD.org  Mon Sep 20 08:53:20 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E7BE61065670
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 20 Sep 2010 08:53:20 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id D6D488FC14
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 20 Sep 2010 08:53:20 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o8K8rJBR063112
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 20 Sep 2010 08:53:19 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o8K8rJKI063111;
	Mon, 20 Sep 2010 08:53:19 GMT
	(envelope-from nobody)
Message-Id: <201009200853.o8K8rJKI063111@www.freebsd.org>
Date: Mon, 20 Sep 2010 08:53:19 GMT
From: YIN Xiaofeng <75394094@qq.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: be not needed to eval $_pidcmd on reboot stage
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         150752
>Category:       conf
>Synopsis:       [rc.subr] [patch] be not needed to eval $_pidcmd on reboot stage
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dougb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 20 09:00:15 UTC 2010
>Closed-Date:    Fri Feb 17 07:45:59 UTC 2012
>Last-Modified:  Fri Feb 17 07:45:59 UTC 2012
>Originator:     YIN Xiaofeng
>Release:        8.1-RELEASE
>Organization:
>Environment:
FreeBSD abc.xyz.com 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:55:53 UTC 2010     root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
If system boots normally, rc script is not necessary to determine rc_pid, and it can boot even faster. Is it right ?
>How-To-Repeat:
reboot your system, you can add one line(line: set -x ) into /etc/rc to view, and you can see _find_process (invoked by check_pidfile or check_process) to be executed.
>Fix:
--- /etc/rc.subr.orig   2010-07-19 10:24:59.000000000 +0800
+++ /etc/rc.subr        2010-09-20 16:44:26.000000000 +0800
@@ -657,7 +657,7 @@
                fi
        fi

-       eval $_pidcmd                   # determine the pid if necessary
+       [ -z "$autoboot" ] && eval $_pidcmd                     # determine the pid if necessary

        for _elem in $_keywords; do
                if [ "$_elem" != "$rc_arg" ]; then



>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-rc 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Sep 26 21:06:17 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=150752 
State-Changed-From-To: open->analyzed 
State-Changed-By: dougb 
State-Changed-When: Fri Oct 7 03:26:08 UTC 2011 
State-Changed-Why:  

I can't see any reason why this is a bad idea, and it seems to work. 


Responsible-Changed-From-To: freebsd-rc->dougb 
Responsible-Changed-By: dougb 
Responsible-Changed-When: Fri Oct 7 03:26:08 UTC 2011 
Responsible-Changed-Why:  

I'll track this one. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=150752 
State-Changed-From-To: analyzed->patched 
State-Changed-By: dougb 
State-Changed-When: Fri Jan 20 10:31:50 UTC 2012 
State-Changed-Why:  

Now that 9.0-RELEASE is done, get this in the pipe. r230374 

http://www.freebsd.org/cgi/query-pr.cgi?pr=150752 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: conf/150752: commit references a PR
Date: Fri, 20 Jan 2012 10:31:37 +0000 (UTC)

 Author: dougb
 Date: Fri Jan 20 10:31:27 2012
 New Revision: 230374
 URL: http://svn.freebsd.org/changeset/base/230374
 
 Log:
   If we're booting there is no need to waste time determining if the service
   is running or not.
   
   PR:		conf/150752
   Submitted by:	YIN Xiaofeng <75394094@qq.com>
 
 Modified:
   head/etc/rc.subr
 
 Modified: head/etc/rc.subr
 ==============================================================================
 --- head/etc/rc.subr	Fri Jan 20 10:06:28 2012	(r230373)
 +++ head/etc/rc.subr	Fri Jan 20 10:31:27 2012	(r230374)
 @@ -641,7 +641,7 @@ run_rc_command()
  		fi
  	fi
  
 -	eval $_pidcmd			# determine the pid if necessary
 +	[ -z "$autoboot" ] && eval $_pidcmd	# determine the pid if necessary
  
  	for _elem in $_keywords; do
  		if [ "$_elem" != "$rc_arg" ]; then
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: dougb 
State-Changed-When: Fri Feb 17 07:45:41 UTC 2012 
State-Changed-Why:  

The change has been MFC'ed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=150752 
>Unformatted:
