[Lunar-commits] r25978 - moonbase/trunk/utils/lunar-init

Auke Kok sofar at lunar-linux.org
Thu Sep 27 01:56:38 CEST 2007


Author: sofar
Date: 2007-09-27 01:56:38 +0200 (Thu, 27 Sep 2007)
New Revision: 25978

Modified:
   moonbase/trunk/utils/lunar-init/DETAILS
   moonbase/trunk/utils/lunar-init/network
Log:
[FIX] ifup interface and setup wpa_supplicant before starting ifplugd

This old order is causing a lot of problems when ifplugd is started
before wpa_supplicant, since the kernel can somehow assign a first-pick
default essid without any configuration. This then makes ifplugd run
dhcpcd immediately before you are connected to the right network, and
then gives you an unusable IP address.

The right order MUST be (1) wpa first, then (2) ifplugd.

In order to do this we clear any and all essid, run ifconfig $1 up and
start wpa_supplicant and ifplugd in order.

*tested*


Modified: moonbase/trunk/utils/lunar-init/DETAILS
===================================================================
--- moonbase/trunk/utils/lunar-init/DETAILS	2007-09-26 18:39:54 UTC (rev 25977)
+++ moonbase/trunk/utils/lunar-init/DETAILS	2007-09-26 23:56:38 UTC (rev 25978)
@@ -2,7 +2,7 @@
          VERSION=0.1
         WEB_SITE=http://lunar-linux.org
          ENTERED=20070404
-         UPDATED=20070921
+         UPDATED=20070926
            SHORT="the Lunar init scripts vital to any system"
          PROFILE=yes
 

Modified: moonbase/trunk/utils/lunar-init/network
===================================================================
--- moonbase/trunk/utils/lunar-init/network	2007-09-26 18:39:54 UTC (rev 25977)
+++ moonbase/trunk/utils/lunar-init/network	2007-09-26 23:56:38 UTC (rev 25978)
@@ -141,18 +141,22 @@
 
 	if [ "$MANAGER" == "wpa_supplicant" ] ; then
 		if [ -x $WPA_SUPPLICANT ] && [ -x $IFPLUGD ] ; then
-			# we start ifplugd prior to wpa_supplicant because then it brings up the interface
-			# but doesn't call the dhcp client since there's no connection yet
-			# Please don't fail here because ifplugd is already running
-	    		if ! $IFPLUGD -c -i $1 &> /dev/null ; then
-              			$IFPLUGD -I -i $1 -f -r /etc/ifplugd/ifplugd-lunar.action
-	    		fi
+			# bring the interface up
+			$IFCONFIG $1 up
 
+			# remove any and all essid
+			$IWCONFIG $1 essid any
+
 			# FIXME: Make the config file configurable. 
-	    		# Also, rely on the configuration to determine whether or not the interface is enabled
-	    		$WPA_SUPPLICANT -B -w -Dwext -i${1} -c/etc/wpa_supplicant.conf
+			# Also, rely on the configuration to determine whether or not the interface is enabled
+			$WPA_SUPPLICANT -B -w -Dwext -i$1 -c/etc/wpa_supplicant.conf
 
-	  	else
+			# finally start ifplugd
+			if ! $IFPLUGD -c -i $1 &> /dev/null ; then
+				$IFPLUGD -I -i $1 -f -r /etc/ifplugd/ifplugd-lunar.action
+			fi
+
+		else
 			echo -n " ERROR: wpa_supplicant and/or ifplugd are missing!"
 			return -1
 		fi



More information about the Lunar-commits mailing list