From nobody@FreeBSD.org  Sat Feb 25 20:07:53 2012
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 78A8C106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 25 Feb 2012 20:07:53 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 4BD3E8FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 25 Feb 2012 20:07:53 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q1PK7rTw074763
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 25 Feb 2012 20:07:53 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q1PK7ruY074762;
	Sat, 25 Feb 2012 20:07:53 GMT
	(envelope-from nobody)
Message-Id: <201202252007.q1PK7ruY074762@red.freebsd.org>
Date: Sat, 25 Feb 2012 20:07:53 GMT
From: Warren Block <wblock@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [rc] dhclient is run twice
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         165477
>Category:       bin
>Synopsis:       [rc] dhclient is run twice
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    hrs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 25 20:10:07 UTC 2012
>Closed-Date:    Mon Feb 24 13:48:46 CET 2014
>Last-Modified:  Mon Feb 24 13:48:46 CET 2014
>Originator:     Warren Block
>Release:        8.3-PRERELEASE
>Organization:
>Environment:
FreeBSD lightning 8.3-PRERELEASE FreeBSD 8.3-PRERELEASE #0: Sat Feb 25 12:20:37 MST 2012     root@lightning:/usr/obj/usr/src/sys/LIGHTNING  i386
>Description:
Since r231278 (MFC of r226345, r226464, r226879), dhclient is executed from devd.conf even when already running.  With ifconfig_em0="SYNCDHCP", this output is produced:

Setting hostname: lightning
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:

From: Warren Block <wblock@wonkity.com>
To: bug-followup@FreeBSD.org, wblock@FreeBSD.org
Cc:  
Subject: Re: bin/165477: [rc] dhclient is run twice
Date: Sat, 25 Feb 2012 15:09:32 -0700 (MST)

 Startup output was truncated, trying again:
 
 Setting hostname: lightning
 .
 Starting dhclient.
 em0: no link ...
 .
 .
   got link
 DHCPREQUEST on em0 to 255.255.255.255 port 67
 DHCPDISCOVER on em0 to 255.255.255.255 port 67 interval 8
 DHCPOFFER from 10.0.0.1
 DHCPREQUEST on em0 to 255.255.255.255 port 67
 DHCPACK from 10.0.0.1
 
 bound to 10.0.0.8 -- renewal in 300 seconds.
 
 Starting Network: lo0 em0.
 lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
          options=3<RXCSUM,TXCSUM>
          inet 127.0.0.1 netmask 0xff000000
 em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 9216
          options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
          ether 00:02:b3:a9:93:d7
          inet 10.0.0.8 netmask 0xffffff00 broadcast 10.0.0.255
          media: Ethernet autoselect (1000baseT <full-duplex>)
          status: active
 Starting devd.
 Starting ums0 moused
 .
 dhclient already running? (pid=290).
 Creating and/or trimming log files
Responsible-Changed-From-To: freebsd-bugs->freebsd-rc 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Mar 12 07:29:12 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer(s). 

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

From: Ian Lepore <freebsd@damnhippie.dyndns.org>
To: bug-followup@FreeBSD.org, wblock@FreeBSD.org
Cc:  
Subject: Re: bin/165477: [rc] dhclient is run twice
Date: Mon, 12 Mar 2012 08:31:24 -0600

 I did some investigation of this when the question first came up on the
 mailing lists.  Here's what I learned...
 
 The first instance of dhclient is started normally by rc.d/dhclient.
 Later, when devd starts, it processes a bach of bufferered up events
 delivered to it by devfs, and one of those events is a LINK_UP event
 which causes devd to run "rc.d/dhclient quietstart".  Changes introduced
 in r226345, merged to 8-stable in r231278, changed the behavior of
 dhclient with the "quietstart" parameter so that it is no longer quiet
 about the fact that an instance of dhclient is already running.
 
 

From: Carmel <carmel_ny@hotmail.com>
To: bug-followup@FreeBSD.org, wblock@FreeBSD.org
Cc:  
Subject: Re: bin/165477: [rc] dhclient is run twice
Date: Sun, 6 May 2012 06:44:42 -0400

 After updating from FreeBSD-8.2 STABLE to FreeBSD-8.3 STABLE, I am
 experiencing the same behavior with "dhclient"
State-Changed-From-To: open->feedback 
State-Changed-By: crees 
State-Changed-When: Fri Nov 2 11:11:17 UTC 2012 
State-Changed-Why:  
Please try out the patch at 
http://www.bayofrum.net/~crees/patches/165477.diff to devd.conf.  It 
does the "right thing", so let me know if it stops your problem. 

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

From: Chris Rees <crees@FreeBSD.org>
To: "bug-followup@freebsd.org" <bug-followup@freebsd.org>
Cc:  
Subject: Re: bin/165477: [rc] dhclient is run twice
Date: Fri, 2 Nov 2012 16:54:19 +0000

 Warren Block wrote:
 >
 > Yes, this prevents the "dhclient already running? (pid=345)" message.
 >
 
 Excellent, I'll try to get it in.
 
 Chris

From: Hiroki Sato <hrs@FreeBSD.org>
To: crees@FreeBSD.org
Cc: wblock@FreeBSD.org, freebsd-rc@FreeBSD.org, bug-followup@FreeBSD.org
Subject: Re: bin/165477: [rc] dhclient is run twice
Date: Sun, 18 Nov 2012 07:59:56 +0900 (JST)

 ----Security_Multipart0(Sun_Nov_18_07_59_56_2012_823)--
 Content-Type: Multipart/Mixed;
  boundary="--Next_Part(Sun_Nov_18_07_59_56_2012_546)--"
 Content-Transfer-Encoding: 7bit
 
 ----Next_Part(Sun_Nov_18_07_59_56_2012_546)--
 Content-Type: Text/Plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 crees@freebsd.org wrote
   in <201211021111.qA2BBHEi008211@freefall.freebsd.org>:
 
 cr> Synopsis: [rc] dhclient is run twice
 cr>
 cr> State-Changed-From-To: open->feedback
 cr> State-Changed-By: crees
 cr> State-Changed-When: Fri Nov 2 11:11:17 UTC 2012
 cr> State-Changed-Why:
 cr> Please try out the patch at
 cr> http://www.bayofrum.net/~crees/patches/165477.diff to devd.conf.  It
 cr> does the "right thing", so let me know if it stops your problem.
 
  I think it is safe to remove the warning message when rc_quiet=YES.
  What do you think about the attached patch?
 
 -- Hiroki
 
 ----Next_Part(Sun_Nov_18_07_59_56_2012_546)--
 Content-Type: Text/X-Patch; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline; filename="rc.subr_quiet_20121118-1.diff"
 
 Index: etc/rc.subr
 ===================================================================
 --- etc/rc.subr	(revision 243184)
 +++ etc/rc.subr	(working copy)
 @@ -704,7 +704,9 @@
 
  		start)
  			if [ -z "$rc_fast" -a -n "$rc_pid" ]; then
 -				echo 1>&2 "${name} already running? (pid=$rc_pid)."
 +				if [ ! -z "$rc_quiet" ]; then
 +					echo 1>&2 "${name} already running? (pid=$rc_pid)."
 +				fi
  				return 1
  			fi
 
 
 ----Next_Part(Sun_Nov_18_07_59_56_2012_546)----
 
 ----Security_Multipart0(Sun_Nov_18_07_59_56_2012_823)--
 Content-Type: application/pgp-signature
 Content-Transfer-Encoding: 7bit
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (FreeBSD)
 
 iEYEABECAAYFAlCoFuwACgkQTyzT2CeTzy1usgCgmqzn4/7Yhr0+fwxOPHqOXW07
 FzUAoLQ/xwkyWXICEt8ptmJZrTq6icRA
 =etD7
 -----END PGP SIGNATURE-----
 
 ----Security_Multipart0(Sun_Nov_18_07_59_56_2012_823)----

From: Chris Rees <crees@FreeBSD.org>
To: Hiroki Sato <hrs@freebsd.org>
Cc: wblock@freebsd.org, "freebsd-rc@freebsd.org" <freebsd-rc@freebsd.org>, 
	"bug-followup@freebsd.org" <bug-followup@freebsd.org>
Subject: Re: bin/165477: [rc] dhclient is run twice
Date: Sun, 18 Nov 2012 14:40:00 +0000

 On 17 November 2012 22:59, Hiroki Sato <hrs@freebsd.org> wrote:
 >
 >  I think it is safe to remove the warning message when rc_quiet=YES.
 >  What do you think about the attached patch?
 
 I had originally considered that, but it then makes dhclient behave
 differently from other scripts; nothing else respects rc_quiet in this
 fashion;
 
 from rc.subr:
                 start)
                         if [ -z "$rc_fast" -a -n "$rc_pid" ]; then
                                 echo 1>&2 "${name} already running?
 (pid=$rc_pid)."
                                 return 1
                         fi
 and
 
 [crees@pegasus]~/workspace/ports/musicpd% sudo service musicpd quietstart
 musicpd already running? (pid=83847).
 
 Chris

From: Ian Lepore <freebsd@damnhippie.dyndns.org>
To: Chris Rees <crees@freebsd.org>
Cc: Hiroki Sato <hrs@freebsd.org>,
        "freebsd-rc@freebsd.org"
 <freebsd-rc@freebsd.org>, wblock@freebsd.org,
        "bug-followup@freebsd.org"
 <bug-followup@freebsd.org>
Subject: Re: bin/165477: [rc] dhclient is run twice
Date: Sun, 18 Nov 2012 07:58:14 -0700

 On Sun, 2012-11-18 at 14:40 +0000, Chris Rees wrote:
 > On 17 November 2012 22:59, Hiroki Sato <hrs@freebsd.org> wrote:
 > >
 > >  I think it is safe to remove the warning message when rc_quiet=YES.
 > >  What do you think about the attached patch?
 > 
 > I had originally considered that, but it then makes dhclient behave
 > differently from other scripts; nothing else respects rc_quiet in this
 > fashion;
 > 
 > from rc.subr:
 >                 start)
 >                         if [ -z "$rc_fast" -a -n "$rc_pid" ]; then
 >                                 echo 1>&2 "${name} already running?
 > (pid=$rc_pid)."
 >                                 return 1
 >                         fi
 > and
 > 
 > [crees@pegasus]~/workspace/ports/musicpd% sudo service musicpd quietstart
 > musicpd already running? (pid=83847).
 > 
 > Chris
 
 If not via the rc_quiet mechanism, then please silence it via some other
 mechanism *to restore historical behavior*.  
 
 In the past, rc.d/dhclient had its own silent pidfile check and in
 general the design was to be silently idempotent (presumably because of
 the way it gets invoked multiple times for the same inteface during rc
 processing).  Somewhere along the line it was changed to use new common
 rc.subr code to handle the pidfile check, but because the new code is
 not silent it wasn't really equivelent to the old code.
 
 As far as I'm concerned the switch to the new noisy pidfile check for
 dhclient amounts to the introduction of a bug.  If it doesn't get
 changed I can see years of explaining to customers (who seem to have
 nothing better to do than spelunk system logs) "don't worry about that,
 it's normal."
 
 -- Ian
 
 
State-Changed-From-To: feedback->patched 
State-Changed-By: hrs 
State-Changed-When: Tue Nov 20 04:45:05 UTC 2012 
State-Changed-Why:  
Committed a patch. 


Responsible-Changed-From-To: freebsd-rc->hrs 
Responsible-Changed-By: hrs 
Responsible-Changed-When: Tue Nov 20 04:45:05 UTC 2012 
Responsible-Changed-Why:  
Committed a patch. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/165477: commit references a PR
Date: Fri, 12 Jul 2013 01:08:20 +0000 (UTC)

 Author: hrs
 Date: Fri Jul 12 01:08:12 2013
 New Revision: 253231
 URL: http://svnweb.freebsd.org/changeset/base/253231
 
 Log:
   MFC 243324:
   
   Do not put "already running" message when rc_quiet=yes.
   
   PR:	bin/165477
 
 Modified:
   stable/9/etc/rc.subr
 Directory Properties:
   stable/9/etc/   (props changed)
 
 Modified: stable/9/etc/rc.subr
 ==============================================================================
 --- stable/9/etc/rc.subr	Fri Jul 12 01:06:08 2013	(r253230)
 +++ stable/9/etc/rc.subr	Fri Jul 12 01:08:12 2013	(r253231)
 @@ -742,7 +742,10 @@ run_rc_command()
  
  		start)
  			if [ -z "$rc_fast" -a -n "$rc_pid" ]; then
 -				echo 1>&2 "${name} already running? (pid=$rc_pid)."
 +				if [ -z "$rc_quiet" ]; then
 +					echo 1>&2 "${name} already running? " \
 +					    "(pid=$rc_pid)."
 +				fi
  				return 1
  			fi
  
 _______________________________________________
 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: brueffer 
State-Changed-When: Mon Feb 24 13:48:23 CET 2014 
State-Changed-Why:  
hrs agrees this has been resolved.  Thanks for the submission! 

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