From nobody@FreeBSD.org  Tue Jan  4 09:42:00 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 0533516A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  4 Jan 2005 09:42:00 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id E557D43D55
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  4 Jan 2005 09:41:59 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j049fxwN082525
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 4 Jan 2005 09:41:59 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j049fxFI082524;
	Tue, 4 Jan 2005 09:41:59 GMT
	(envelope-from nobody)
Message-Id: <200501040941.j049fxFI082524@www.freebsd.org>
Date: Tue, 4 Jan 2005 09:41:59 GMT
From: Radko Keves <rado@daemon.sk>
To: freebsd-gnats-submit@FreeBSD.org
Subject: typo and useless part in /etc/pccard_ether
X-Send-Pr-Version: www-2.3

>Number:         75786
>Category:       conf
>Synopsis:       typo and useless part in /etc/pccard_ether
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    ceri
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 04 09:50:25 GMT 2005
>Closed-Date:    Mon Jan 17 11:49:56 GMT 2005
>Last-Modified:  Mon Jan 17 11:49:56 GMT 2005
>Originator:     Radko Keves
>Release:        FreeBSD 5.3-RELEASE-p1 i386
>Organization:
nothing
>Environment:
FreeBSD gaila 5.3-RELEASE-p1 FreeBSD 5.3-RELEASE-p1 #0: Wed Dec 1 01:00:
40 CET 2004 root@:/usr/src/sys/i386/compile/angel i386
>Description:
        There is a typo in /etc/pccard_ether file
        and one part which is probably not used in
        this moment.
        
        As is said in /etc/devd.conf
        For ethernet like devices, the default is to run dhclient.        Due to a historical accident, this script is called pccard_ether.

        In this moment pccard_ether isn't working,
        this can be problem in many cases. 

>How-To-Repeat:
      Run:
/etc/pccard_ether <nic-name> <start|stop>

>Fix:
--- /etc/pccard_ether   Tue Nov  9 15:34:37 2004
+++ /etc/pccard_ether.fixed     Sat Jan  1
14:04:42 2005
@@ -123,18 +123,8 @@

 interface=$1
 shift
-startstop=$1
+startstop=$2
 shift
-
-case ${pccard_ifconfig} in
-[Nn][Oo] | '')
-       expr "${removable_interfaces}" : ".*${interface}" > /dev/null || exit 0
-       ;;
-*)
-       # Backward compatible
-       eval ifconfig_${interface}=\${pccard_ifconfig}
-       ;;
-esac

>Release-Note:
>Audit-Trail:

From: Ceri Davies <ceri@submonkey.net>
To: Radko Keves <rado@daemon.sk>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/75786: typo and useless part in /etc/pccard_ether
Date: Tue, 4 Jan 2005 11:58:14 +0000

 On Tue, Jan 04, 2005 at 09:41:59AM +0000, Radko Keves wrote:
 
 >  interface=$1
 >  shift
 > -startstop=$1
 > +startstop=$2
 >  shift
 
 That isn't a typo.
 
 > -case ${pccard_ifconfig} in
 > -[Nn][Oo] | '')
 > -       expr "${removable_interfaces}" : ".*${interface}" > /dev/null || exit 0
 > -       ;;
 > -*)
 > -       # Backward compatible
 > -       eval ifconfig_${interface}=\${pccard_ifconfig}
 > -       ;;
 > -esac
 
 This doesn't look useless.
 
 Could you explain your rationale a bit more please?
 
 Ceri

From: Radko Keves <rado@daemon.sk>
To: Ceri Davies <ceri@submonkey.net>
Cc:  
Subject: Re: bin/75786: typo and useless part in /etc/pccard_ether
Date: Tue, 4 Jan 2005 13:01:28 +0100

 Tue, Jan 04, 2005 at 11:58:14AM +0000, Ceri Davies said that
 > On Tue, Jan 04, 2005 at 09:41:59AM +0000, Radko Keves wrote:
 > 
 > >  interface=$1
 > >  shift
 > > -startstop=$1
 > > +startstop=$2
 > >  shift
 > 
 > That isn't a typo.
 
 I'm not sure
 
 > 
 > > -case ${pccard_ifconfig} in
 > > -[Nn][Oo] | '')
 > > -       expr "${removable_interfaces}" : ".*${interface}" > /dev/null || exit 0
 > > -       ;;
 > > -*)
 > > -       # Backward compatible
 > > -       eval ifconfig_${interface}=\${pccard_ifconfig}
 > > -       ;;
 > > -esac
 > 
 > This doesn't look useless.
 > 
 > Could you explain your rationale a bit more please?
 
 in this moment:
 /etc/pccard_ether $device-name <start|stop>
 
 isn't working, but after my changes is.
 
 Command
 /etc/pccard_ether $device-name <start|stop>
 is used for example in /etc/devd.conf
 
 > 
 > Ceri
 
 Please run /etc/pccard_ether $device-name <start|stop>
 
 and you will see.
 
 Regards,
 -- 
 You wouldn't take candy from strangers, would you?
 [msdn]

From: Ceri Davies <ceri@submonkey.net>
To: Radko Keves <rado@daemon.sk>
Cc: FreeBSD Gnats Submit <freebsd-gnats-submit@FreeBSD.org>
Subject: Re: bin/75786: typo and useless part in /etc/pccard_ether
Date: Tue, 4 Jan 2005 12:10:41 +0000

 On Tue, Jan 04, 2005 at 01:01:28PM +0100, Radko Keves wrote:
 > Tue, Jan 04, 2005 at 11:58:14AM +0000, Ceri Davies said that
 > > On Tue, Jan 04, 2005 at 09:41:59AM +0000, Radko Keves wrote:
 > > 
 > > >  interface=$1
 > > >  shift
 > > > -startstop=$1
 > > > +startstop=$2
 > > >  shift
 > > 
 > > That isn't a typo.
 > 
 > I'm not sure
 
 I am.
 
 > > > -case ${pccard_ifconfig} in
 > > > -[Nn][Oo] | '')
 > > > -       expr "${removable_interfaces}" : ".*${interface}" > /dev/null || exit 0
 > > > -       ;;
 > > > -*)
 > > > -       # Backward compatible
 > > > -       eval ifconfig_${interface}=\${pccard_ifconfig}
 > > > -       ;;
 > > > -esac
 > > 
 > > This doesn't look useless.
 > > 
 > > Could you explain your rationale a bit more please?
 > 
 > in this moment:
 > /etc/pccard_ether $device-name <start|stop>
 > 
 > isn't working, but after my changes is.
 > 
 > Please run /etc/pccard_ether $device-name <start|stop>
 > 
 > and you will see.
 
 Do you have removable_interfaces set appropriately in /etc/rc.conf?
 If you believe so, please post your rc.conf.
 
 Ceri

From: Ceri Davies <ceri@submonkey.net>
To: Radko Keves <rado@daemon.sk>
Cc: FreeBSD Gnats Submit <freebsd-gnats-submit@FreeBSD.org>
Subject: Re: bin/75786: typo and useless part in /etc/pccard_ether
Date: Tue, 4 Jan 2005 12:22:23 +0000

 On Tue, Jan 04, 2005 at 01:19:41PM +0100, Radko Keves wrote:
 > Tue, Jan 04, 2005 at 12:10:41PM +0000, Ceri Davies said that
 > > On Tue, Jan 04, 2005 at 01:01:28PM +0100, Radko Keves wrote:
 > > > Tue, Jan 04, 2005 at 11:58:14AM +0000, Ceri Davies said that
 > > > > On Tue, Jan 04, 2005 at 09:41:59AM +0000, Radko Keves wrote:
 > > > > 
 > > > > > -case ${pccard_ifconfig} in
 > > > > > -[Nn][Oo] | '')
 > > > > > -       expr "${removable_interfaces}" : ".*${interface}" > /dev/null || exit 0
 > > > > > -       ;;
 > > > > > -*)
 > > > > > -       # Backward compatible
 > > > > > -       eval ifconfig_${interface}=\${pccard_ifconfig}
 > > > > > -       ;;
 > > > > > -esac
 > > > > 
 > > > > This doesn't look useless.
 > > > > 
 > > > > Could you explain your rationale a bit more please?
 > > > 
 > > > in this moment:
 > > > /etc/pccard_ether $device-name <start|stop>
 > > > 
 > > > isn't working, but after my changes is.
 > > > 
 > > > Please run /etc/pccard_ether $device-name <start|stop>
 > > > 
 > > > and you will see.
 > > 
 > > Do you have removable_interfaces set appropriately in /etc/rc.conf?
 > > If you believe so, please post your rc.conf.
 > 
 > I'm not sure what do you mean with removable interface, and where is the
 > your point, but i'm sure /etc/pccard_ether $device-name <start|stop> is
 > not working.
 > 
 > $ grep ifconfig /etc/rc.conf
 > ifconfig_bge0="DHCP"
 > 
 > I'm not talking about "devd", but about setting up dhcp with
 > pccard_ether script.
 > 
 > but:
 > $ grep -i removable /etc/defaults/rc.conf
 > removable_interfaces="" # Removable network interfaces for
 > /etc/pccard_ether.
 > $ 
 > $ grep -i removable /etc/rc.conf         
 > $ 
 > 
 > After i specified removable_interface:
 > (sorry i didn't know it is mandatory for pccard_ether script)
 > $ grep -i removable /etc/rc.conf         
 > removable_interfaces="bge0" # Removable network
 
 OK, that's one down. You must set that.
 
 > and run (original script):
 > $ sudo /etc/pccard_ether stop
 > shift: can't shift that many
 > $ 
 > 
 > so still i'm not sure about $1 shifter twice.
 
 You're not passing in the interface name - the correct invocation is:
 	/etc/pccard_ether bge0 stop
 
 > Sorry, if i didn't specified it before.
 
 No problem.
 
 Ceri
Responsible-Changed-From-To: freebsd-bugs->ceri 
Responsible-Changed-By: ceri 
Responsible-Changed-When: Tue Jan 4 14:48:39 GMT 2005 
Responsible-Changed-Why:  
I'm working with the submitter on this offline. 

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

From: Ceri Davies <ceri@submonkey.net>
To: FreeBSD Gnats Submit <freebsd-gnats-submit@FreeBSD.org>
Cc:  
Subject: Re: bin/75786: typo and useless part in /etc/pccard_ether
Date: Tue, 4 Jan 2005 15:53:33 +0000

 Adding to audit trail:
 
 > > > > Tue, Jan 04, 2005 at 11:58:14AM +0000, Ceri Davies said that
 > > > > > On Tue, Jan 04, 2005 at 09:41:59AM +0000, Radko Keves wrote:
 > 
 > > and run (original script):
 > > $ sudo /etc/pccard_ether stop
 > > shift: can't shift that many
 > > $ 
 > > 
 > > so still i'm not sure about $1 shifter twice.
 > 
 > You're not passing in the interface name - the correct invocation is:
 > 	/etc/pccard_ether bge0 stop
 
 That's right:
 su-2.05b# /etc/pccard_ether bge0 stop
 Starting: Can't open Starting: No such file or directory
 su-2.05b# 
 
 > 
 > > Sorry, if i didn't specified it before.
 > 
 > No problem.
 > 
 
 Did you try it on some box ?
 
 I hope this time i did it right.
 
 > Ceri
 
 Rado

From: Ceri Davies <ceri@submonkey.net>
To: Radko Keves <rado@daemon.sk>
Cc:  
Subject: Re: bin/75786: typo and useless part in /etc/pccard_ether
Date: Tue, 4 Jan 2005 12:49:57 +0000

 On Tue, Jan 04, 2005 at 01:32:43PM +0100, Radko Keves wrote:
 > > > and run (original script):
 > > > $ sudo /etc/pccard_ether stop
 > > > shift: can't shift that many
 > > > $ 
 > > > 
 > > > so still i'm not sure about $1 shifter twice.
 > > 
 > > You're not passing in the interface name - the correct invocation is:
 > > 	/etc/pccard_ether bge0 stop
 > 
 > That's right:
 > su-2.05b# /etc/pccard_ether bge0 stop
 > Starting: Can't open Starting: No such file or directory
 > su-2.05b# 
 
 Hmm, that's really strange.  What revision of pccard_ether do you have?
 Does it contain the string "Starting"?
 
 > Did you try it on some box ?
 
 Yes, I cannot reproduce that here.  Could you please also try:
 
 	sh -x /etc/pccard_ether bge0 stop
 
 
 Thanks.
 
 Ceri

From: Ceri Davies <ceri@submonkey.net>
To: FreeBSD Gnats Submit <freebsd-gnats-submit@FreeBSD.org>
Cc:  
Subject: Re: bin/75786: typo and useless part in /etc/pccard_ether
Date: Tue, 4 Jan 2005 16:00:12 +0000

 Adding to audit trail.  Attachments stored at
 http://people.freebsd.org/~ceri/pr/75786/ due to their size.
 
 Tue, Jan 04, 2005 at 12:49:57PM +0000, Ceri Davies said that
 > On Tue, Jan 04, 2005 at 01:32:43PM +0100, Radko Keves wrote:
 > > > > and run (original script):
 > > > > $ sudo /etc/pccard_ether stop
 > > > > shift: can't shift that many
 > > > > $ 
 > > > > 
 > > > > so still i'm not sure about $1 shifter twice.
 > > > 
 > > > You're not passing in the interface name - the correct invocation is:
 > > > 	/etc/pccard_ether bge0 stop
 > > 
 > > That's right:
 > > su-2.05b# /etc/pccard_ether bge0 stop
 > > Starting: Can't open Starting: No such file or directory
 > > su-2.05b# 
 > 
 > Hmm, that's really strange.  What revision of pccard_ether do you have?
 > Does it contain the string "Starting"?
 
 No. (file attached)
 > 
 > > Did you try it on some box ?
 > 
 > Yes, I cannot reproduce that here.  Could you please also try:
 > 
 > 	sh -x /etc/pccard_ether bge0 stop
 
 Done
 sh -x /etc/pccard_ether bge0 stop 2> 2.out > 1.out
 
 (1.out and 2.out attached)
 
 
 I hope it isn't only my problem.
 
 really strange
 (dhclient attached too)
 
 > 
 > 
 > Thanks.
 > 
 > Ceri
 
 -- 
 You wouldn't take candy from strangers, would you?
 [msdn]
 
 

From: Ceri Davies <ceri@submonkey.net>
To: Radko Keves <rado@daemon.sk>
Cc:  
Subject: Re: bin/75786: typo and useless part in /etc/pccard_ether
Date: Tue, 4 Jan 2005 14:20:56 +0000

 --uAgJxtfIS94j9H4T
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 On Tue, Jan 04, 2005 at 01:59:01PM +0100, Radko Keves wrote:
 > Tue, Jan 04, 2005 at 12:49:57PM +0000, Ceri Davies said that
 > > On Tue, Jan 04, 2005 at 01:32:43PM +0100, Radko Keves wrote:
 > > > > > and run (original script):
 > > > > > $ sudo /etc/pccard_ether stop
 > > > > > shift: can't shift that many
 > > > > > $ 
 > > > > > 
 > > > > > so still i'm not sure about $1 shifter twice.
 > > > > 
 > > > > You're not passing in the interface name - the correct invocation is:
 > > > > 	/etc/pccard_ether bge0 stop
 > > > 
 > > > That's right:
 > > > su-2.05b# /etc/pccard_ether bge0 stop
 > > > Starting: Can't open Starting: No such file or directory
 > > > su-2.05b# 
 > > 
 > > Hmm, that's really strange.  What revision of pccard_ether do you have?
 > > Does it contain the string "Starting"?
 > 
 > No. (file attached)
 > > 
 > > > Did you try it on some box ?
 > > 
 > > Yes, I cannot reproduce that here.  Could you please also try:
 > > 
 > > 	sh -x /etc/pccard_ether bge0 stop
 > 
 > Done
 > sh -x /etc/pccard_ether bge0 stop 2> 2.out > 1.out
 > 
 > (1.out and 2.out attached)
 > 
 > 
 > I hope it isn't only my problem.
 
 Brilliant.  Please try the attached patch to /etc/pccard_ether.
 
 Ceri
 -- 
 Only two things are infinite, the universe and human stupidity, and I'm
 not sure about the former.			  -- Einstein (attrib.)
 
 --uAgJxtfIS94j9H4T
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="pccard.diff"
 
 Index: etc/pccard_ether
 ===================================================================
 RCS file: /home/ncvs/src/etc/pccard_ether,v
 retrieving revision 1.41
 diff -u -r1.41 pccard_ether
 --- etc/pccard_ether	6 Jun 2004 11:46:27 -0000	1.41
 +++ etc/pccard_ether	4 Jan 2005 14:18:52 -0000
 @@ -70,7 +70,7 @@
  	case ${startstop} in
  	[Ss][Tt][Oo][Pp])
  		if [ -z "${_nlist}" ]; then
 -			sh `/etc/rc.d/dhclient start`
 +			sh /etc/rc.d/dhclient stop
  		else
  			start_dhcp_keep_current
  		fi
 
 --uAgJxtfIS94j9H4T--

From: Radko Keves <rado@daemon.sk>
To: Ceri Davies <ceri@submonkey.net>
Cc:  
Subject: Re: bin/75786: typo and useless part in /etc/pccard_ether
Date: Tue, 4 Jan 2005 16:01:56 +0100

 hello,
 
 So it was typo but another :-)
 
 your patch is working, but there is no pid file, so probably it will be
 good to add:
 -pf /var/run/dhclient.pid
 
 into /etc/rc.d/dhclient if isn't specified in rc.conf , something like this: 
 
  if checkyesno_pidfile_dhclient; then
          rc_flags="${rc_flags} -pf /var/run/dhclient.pid"
  fi
  rc_flags="${rc_flags} ${_cooked_list}"
  return 0
 
 
 
 because, if pid file isn't specified in rc.conf (in generaly not) there
 is a error message:
 dhclient not running? (check /var/run/dhclient.pid).
 ifconfig: ioctl (SIOCDIFADDR): Can't assign requested address
 
 
 (but it is only idea :-)
 
 Regards,
 -- 
 You wouldn't take candy from strangers, would you?
 [msdn]

From: Ceri Davies <ceri@submonkey.net>
To: Radko Keves <rado@daemon.sk>
Cc: FreeBSD Gnats Submit <freebsd-gnats-submit@FreeBSD.org>
Subject: Re: bin/75786: typo and useless part in /etc/pccard_ether
Date: Tue, 4 Jan 2005 16:18:32 +0000

 On Tue, Jan 04, 2005 at 04:10:17PM +0000, Radko Keves wrote:
 > The following reply was made to PR bin/75786; it has been noted by GNATS.
 > 
 > From: Radko Keves <rado@daemon.sk>
 > To: Ceri Davies <ceri@submonkey.net>
 > Cc:  
 > Subject: Re: bin/75786: typo and useless part in /etc/pccard_ether
 > Date: Tue, 4 Jan 2005 16:01:56 +0100
 > 
 >  hello,
 >  
 >  So it was typo but another :-)
 
 Great news - I'll commit the fix shortly.
 
 >  your patch is working, but there is no pid file, so probably it will be
 >  good to add:
 >  -pf /var/run/dhclient.pid
 >  
 >  into /etc/rc.d/dhclient if isn't specified in rc.conf , something like this: 
 
 Hmm, dhclient should default to /var/run/dhclient.pid if this is not
 passed in - doesn't this file get created?
 
 Ceri
State-Changed-From-To: open->patched 
State-Changed-By: ceri 
State-Changed-When: Tue Jan 4 16:52:25 GMT 2005 
State-Changed-Why:  
Patch applied to -CURRENT; I'll MFC it to RELENG_5 in 5 days' time if 
no problems arise. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=75786 
State-Changed-From-To: patched->closed 
State-Changed-By: ceri 
State-Changed-When: Mon Jan 17 11:49:10 GMT 2005 
State-Changed-Why:  
r1.43 should correct this problem, and the one in 75808 - see that PR 
for more detail. 

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