From owner-freebsd-net@FreeBSD.ORG Mon Feb 11 16:07:59 2008 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB83216A418 for ; Mon, 11 Feb 2008 16:07:59 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (cl-162.ewr-01.us.sixxs.net [IPv6:2001:4830:1200:a1::2]) by mx1.freebsd.org (Postfix) with ESMTP id 41CD813C442 for ; Mon, 11 Feb 2008 16:07:59 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.1/8.13.8) with ESMTP id m1BG7vu1076863; Mon, 11 Feb 2008 10:07:57 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.1/8.13.8/Submit) id m1BG7uXE076862; Mon, 11 Feb 2008 10:07:56 -0600 (CST) (envelope-from brooks) Date: Mon, 11 Feb 2008 10:07:56 -0600 From: Brooks Davis To: Robert Jenssen Message-ID: <20080211160756.GB69153@lor.one-eyed-alien.net> References: <200802111137.21550.robertjenssen@ozemail.com.au> <20080211010626.GA69153@lor.one-eyed-alien.net> <200802111323.57387.robertjenssen@ozemail.com.au> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0eh6TmSyL6TZE2Uz" Content-Disposition: inline In-Reply-To: <200802111323.57387.robertjenssen@ozemail.com.au> User-Agent: Mutt/1.5.16 (2007-06-09) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Mon, 11 Feb 2008 10:07:58 -0600 (CST) Cc: net@freebsd.org Subject: Re: dhclient conflict between /sbin/devd and /etc/rc.d/netif ? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Feb 2008 16:07:59 -0000 --0eh6TmSyL6TZE2Uz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 11, 2008 at 01:23:57PM +1100, Robert Jenssen wrote: > Hi, >=20 > Thanks for the prompt reply. By "owned", I meant that "ps -ajx"=20 > shows /sbin/devd as the process group leader. For example, at the moment = on=20 > my system: >=20 > [root etc]ps -axj | grep devd > root 5727 1 5727 5727 0 Is ?? 0:00.00 /sbin/devd > [root etc]ps -axj | grep dhclient > root 6373 1 5727 5727 0 I ?? 0:00.00 dhclient: ral0 > _dhcp 6395 1 6395 6395 0 Ss ?? 0:00.09 dhclient: ral0 > [root etc] =20 >=20 > I agree, /sbin/devd calls /etc/rc.d/dhclient which checks for the existen= ce of=20 > a running dhclient. I find the rc scripts hard to follow but so far as I = can=20 > see /etc/rc.d/netif simply calls "ifconfig dhcp" and doesn't check for a= =20 > running dhclient. The head of the process group is completely irrelevent and has no effect. /etc/rc.d/netif litereally calls /etc/rc.d/dhclient is most definitly does = not call "ifconfig dhcp" since no varient of that has ever worked. if dhcpif $1; then if [ $_cfg -ne 0 ] ; then ifconfig $1 up fi if syncdhcpif $1; then /etc/rc.d/dhclient start $1 fi _cfg=3D0 fi > Here are the relevant lines in my rc.conf: >=20 > rc_debug=3D"YES" > ifconfig_ral0=3D"inet dhcp channel 10 wpa up" "inet" is wrong here and "channel 10" is pointless unless you're running an AP or in ad-hoc mode. You're basically luck that anything works for you since this generates a completely bogus ifconfig command. > devd_enable=3D"YES" >=20 > Here is the output of "/etc/rc.d/netif restart": >=20 > [root etc]rc.d/netif restart > rc.d/netif: DEBUG: run_rc_command: doit: network_stop > Stopping network:Stopping wpa_supplicant. > /etc/rc.d/wpa_supplicant: DEBUG: run_rc_command: doit: kill -TERM 6229 > /etc/rc.d/dhclient: DEBUG: run_rc_command: doit: dhclient_stop > lo0 fwip0 fwe0 rl0 ral0 plip0rc.d/netif: DEBUG: The following interfaces= were=20 > not configured: > . > rc.d/netif: DEBUG: run_rc_command: doit: network_start > rc.d/netif: DEBUG: Cloned: > Starting wpa_supplicant. > /etc/rc.d/wpa_supplicant: DEBUG: run_rc_command:=20 > doit: /usr/sbin/wpa_supplicant -q -B -i ral0 -c /etc/wpa_supplicant.conf= -D=20 > bsd -P /var/run/wpa_supplicant/ral0.pid > rc.d/netif: DEBUG: checkyesno: synchronous_dhclient is set to YES. > /etc/rc.d/dhclient: DEBUG: run_rc_command: doit: dhclient_start > /etc/rc.d/dhclient: DEBUG: checkyesno: background_dhclient is set to NO. > ral0: no link ............ got link > DHCPREQUEST on ral0 to 255.255.255.255 port 67 > DHCPDISCOVER on ral0 to 255.255.255.255 port 67 interval 8 > DHCPOFFER from 192.168.0.1 > DHCPREQUEST on ral0 to 255.255.255.255 port 67 > DHCPACK from 192.168.0.1 > bound to 192.168.0.4 -- renewal in 43200 seconds. > lo0: flags=3D8049 metric 0 mtu 16384 > inet6 fe80::1%lo0 prefixlen 64 scopeid 0x6 > inet6 ::1 prefixlen 128 > inet 127.0.0.1 netmask 0xff000000 > ral0: flags=3D8843 metric 0 mtu 1= 500 > ether 00:xx:.... > inet 192.168.0.4 netmask 0xffffff00 broadcast 192.168.0.255 > media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/54Mbps) > status: associated > ssid xxxxxxxxxxxx channel 10 (2457 Mhz 11g) bssid 00:xx:..... > authmode WPA privacy ON deftxkey UNDEF TKIP 3:128-bit txpower 50 > bmiss 7 scanvalid 60 bgscan bgscanintvl 300 bgscanidle 250 > roam:rssi11g 7 roam:rate11g 5 protmode CTS roaming MANUAL > rc.d/netif: DEBUG: The following interfaces were not configured: fwip0 f= we0=20 > rl0 plip0 > /etc/rc.d/ipfilter: DEBUG: checkyesno: ipfilter_enable is set to NO. >=20 > Now I have four dhclient processes: >=20 > [root etc]ps -axj | grep dhclient > root 9824 1 5727 5727 0 S ?? 0:00.00 dhclient: ral= 0=20 > [pri > _dhcp 9853 1 9853 9853 0 Ss ?? 0:00.00 dhclient: ral= 0=20 > (dhc > _dhcp 9880 1 9880 9880 0 Ss ?? 0:00.00 dhclient: ral= 0=20 > (dhc > root 9826 1 9283 1916 0 S p0 0:00.00 dhclient: ral= 0=20 > [pri >=20 > It seems that devd has started two new dhclients and netif has started it= s own=20 > pair as well. 1916 is the process id of the bash shell I su'ed from to=20 > start /etc/rc.d/netif. Does you still set four processes in the steady state? That shouldn't happ= en since starting a second dhclient is supposed to kill the existing one. There should be two processes per interface due to the privege seperation model used by dhclient. -- Brooks --0eh6TmSyL6TZE2Uz Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFHsHLcXY6L6fI4GtQRArJTAJ9f56GRQE13K2BoJK0sUFefO0mATQCeNETM qphBZU/F+YeUDnZTjNJh2IE= =jPf5 -----END PGP SIGNATURE----- --0eh6TmSyL6TZE2Uz--