LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-27-2006, 03:46 PM   #1
lucasrj
LQ Newbie
 
Registered: Apr 2004
Posts: 22

Rep: Reputation: 0
Unhappy wpa_supplicant loads twice on boot, HELP


Hello,

I am running the current version of SLAMD64 on my Gateway 7422GX laptop. I have a wireless network at my home and I use WPA-PSK for encryption. When the laptop boots up, wpa_suplicant is invoked twice and will not connect to my router. I can,however, connect to my router by killing both of the wpa_suplicant processes and running "/etc/rc.d/rc.inet1 -restart".

Only one instance of wpa_suplicant runs when I manually run the rd.inet1 script, but when the computer turns on and runs the very same script somehow it gets loaded twice.

here is the output of "ps ax | grep wpa_suplicant" after the computer boots up initially.
Code:
2139 ?        S<s    0:00 /usr/local/sbin/wpa_supplicant -c/etc/wpa_supplicant.conf -Dwext -Bw -iwlan0
 2141 ?        Ss     0:00 /usr/local/sbin/wpa_supplicant -c/etc/wpa_supplicant.conf -Dwext -Bw -iwlan0
here is a clip from "/etc/var/messages"
Code:
Dec 27 16:29:49 deepthought logger: /etc/rc.d/rc.inet1:  /sbin/modprobe wlan0
Dec 27 16:29:49 deepthought kernel: ndiswrapper version 1.31 loaded (preempt=no,smp=no)
Dec 27 16:29:49 deepthought kernel: ndiswrapper (link_pe_images:577): fixing KI_USER_SHARED_DATA address in the driver
Dec 27 16:29:49 deepthought kernel: ndiswrapper: driver netbc564 (,10/01/2002,3.70.17.5) loaded
Dec 27 16:29:49 deepthought kernel: GSI 21 sharing vector 0xD1 and IRQ 21
Dec 27 16:29:49 deepthought kernel: ACPI: PCI Interrupt 0000:00:0c.0[A] -> GSI 18 (level, low) -> IRQ 21
Dec 27 16:29:49 deepthought kernel: ndiswrapper: using IRQ 21
Dec 27 16:29:49 deepthought kernel: wlan0: ethernet device 00:90:4b:c2:66:42 using NDIS driver: netbc564, version: 0x3461105, NDIS version: 0x501, vendor: '', 14E4:4320.5.conf
Dec 27 16:29:49 deepthought kernel: wlan0: encryption modes supported: WEP; TKIP with WPA; AES/CCMP with WPA
Dec 27 16:29:49 deepthought kernel: usbcore: registered new driver ndiswrapper
Dec 27 16:29:51 deepthought logger: /etc/rc.d/rc.M:  wpa_supplicant -Bw -c/etc/wpa_supplicant.conf -Dwext -iwlan0
Dec 27 16:29:51 deepthought logger: /etc/rc.d/rc.inet1:  wpa_supplicant -Bw -c/etc/wpa_supplicant.conf -Dwext -iwlan0
Dec 27 16:30:02 deepthought logger: WPA authentication did not complete, try running '/etc/rc.d/rc.inet1 wlan0_start' in a few seconds.
Dec 27 16:30:02 deepthought logger: WPA authentication did not complete, try running '/etc/rc.d/rc.inet1 wlan0_start' in a few seconds.
Dec 27 16:30:03 deepthought kernel: NET: Registered protocol family 10
Dec 27 16:30:03 deepthought kernel: lo: Disabled Privacy Extensions
Dec 27 16:30:03 deepthought kernel: ADDRCONF(NETDEV_UP): wlan0: link is not ready

this is my rc.inet1 file
Code:
#! /bin/sh
# /etc/rc.d/rc.inet1
# This script is used to bring up the various network interfaces.
#
# @(#)/etc/rc.d/rc.inet1 10.2  Sun Jul 24 12:45:56 PDT 2005  (pjv)

############################
# READ NETWORK CONFIG FILE #
############################

# Get the configuration information from /etc/rc.d/rc.inet1.conf:
. /etc/rc.d/rc.inet1.conf

###########
# LOGGING #
###########

# If possible, log events in /var/log/messages:
if [ -f /var/run/syslogd.pid -a -x /usr/bin/logger ]; then
  LOGGER=/usr/bin/logger
else # output to stdout/stderr:
  LOGGER=/bin/cat
fi

############################
# DETERMINE INTERFACE LIST #
############################

# Compose a list of interfaces from /etc/rc.d/rc.inet1.conf (with a maximum
# of 6 interfaces, but you can easily enlarge the interface limit
# - send me a picture of such a box :-).
# If a value for IFNAME[n] is not set, we assume it is an eth'n' interface.
# This way, the new script is compatible with older rc.inet1.conf files.
# The IFNAME array will be used to determine which interfaces to bring up/down.
MAXNICS=6
i=0
while [ $i -lt $MAXNICS ];
do
  IFNAME[$i]=${IFNAME[$i]:=eth${i}}
  i=$(($i+1))
done
if [ "$DEBUG_ETH_UP" = "yes" ]; then
  echo "/etc/rc.d/rc.inet1:  List of interfaces: '${IFNAME[@]}'" | $LOGGER
fi

######################
# LOOPBACK FUNCTIONS #
######################

# Function to bring up the loopback interface.  If loopback is
# already up, do nothing.
lo_up() {
  if grep lo: /proc/net/dev 1> /dev/null ; then
    if ! /sbin/ifconfig | grep "^lo" 1> /dev/null ; then
      echo "/etc/rc.d/rc.inet1:  /sbin/ifconfig lo 127.0.0.1" | $LOGGER
      /sbin/ifconfig lo 127.0.0.1
      echo "/etc/rc.d/rc.inet1:  /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo" | $LOGGER
      /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo
    fi
  fi
}

# Function to take down the loopback interface:
lo_down() {
  if grep lo: /proc/net/dev 1> /dev/null ; then
    echo "/etc/rc.d/rc.inet1:  /sbin/ifconfig lo down" | $LOGGER
    /sbin/ifconfig lo down
  fi
}

#######################
# INTERFACE FUNCTIONS #
#######################

# Function to bring up a network interface.  If the interface is
# already up or does not yet exist (perhaps because the kernel driver
# is not loaded yet), do nothing.
if_up() {
  # Determine position 'i' of this interface in the IFNAME array:
  i=0
  while [ $i -lt $MAXNICS ]; do
    [ "${IFNAME[$i]}" = "${1}" ] && break
    i=$(($i+1))
  done
  # If the interface isn't in the kernel yet (but there's an alias for it in
  # modules.conf), then it should be loaded first:
  if ! grep `echo ${1}: | cut -f 1 -d :`: /proc/net/dev 1> /dev/null ; then # no interface yet
    if /sbin/modprobe -c | grep -w "alias ${1}" | grep -vw "alias ${1} off" > /dev/null ; then
      echo "/etc/rc.d/rc.inet1:  /sbin/modprobe ${1}" | $LOGGER
      /sbin/modprobe ${1}
    fi
  fi
  if grep `echo ${1}: | cut -f 1 -d :`: /proc/net/dev 1> /dev/null ; then # interface exists
    if ! /sbin/ifconfig | grep -w "${1}" 1>/dev/null || \
      ! /sbin/ifconfig ${1} | grep "inet addr" 1> /dev/null ; then # interface not up or not configured
      if [ ! "${HWADDR[$i]}" = "" ]; then # Set hardware address _before_ the interface goes up:
        echo "/etc/rc.d/rc.inet1:  /sbin/ifconfig ${1} hw ether ${HWADDR[$i]}" | $LOGGER
        /sbin/ifconfig ${1} hw ether ${HWADDR[$i]}
      fi
      if [ ! "${MTU[$i]}" = "" ]; then # Set MTU to something else than 1500
        echo "/etc/rc.d/rc.inet1:  /sbin/ifconfig ${1} mtu ${MTU[$i]}" | $LOGGER
        /sbin/ifconfig ${1} mtu ${MTU[$i]}
      fi
      if [ -x /etc/rc.d/rc.wireless ]; then
        . /etc/rc.d/rc.wireless ${1} start # Initialize any wireless parameters
      fi
      if [ "${USE_DHCP[$i]}" = "yes" ]; then # use DHCP to bring interface up
        [ ${DHCP_HOSTNAME[$i]} ] && DHCP_OPTIONS="-h ${DHCP_HOSTNAME[$i]}"
        [ "${DHCP_KEEPRESOLV[$i]}" = "yes" ] && DHCP_OPTIONS="$DHCP_OPTIONS -R"
        [ "${DHCP_KEEPNTP[$i]}" = "yes" ] && DHCP_OPTIONS="$DHCP_OPTIONS -N"
        [ "${DHCP_KEEPGW[$i]}" = "yes" ] && DHCP_OPTIONS="$DHCP_OPTIONS -G"
        [ ${DHCP_IPADDR[$i]} ] && DHCP_OPTIONS="$DHCP_OPTIONS -s ${DHCP_IPADDR[$i]}"
        echo "/etc/rc.d/rc.inet1:  /sbin/dhcpcd -d -t 60 ${DHCP_OPTIONS} ${1}" | $LOGGER
        /sbin/dhcpcd -d -t 60 ${DHCP_OPTIONS} ${1}
      else # bring up interface using a static IP address
        if [ ! "${IPADDR[$i]}" = "" ]; then # skip unconfigured interfaces
          # Determine broadcast address from the IP address and netmask:
          BROADCAST[$i]=`/bin/ipmask ${NETMASK[$i]} ${IPADDR[$i]}|cut -f1 -d' '`
          # Set up the network card:
          echo "/etc/rc.d/rc.inet1:  /sbin/ifconfig ${1} ${IPADDR[$i]} broadcast ${BROADCAST[$i]} netmask ${NETMASK[$i]}" | $LOGGER
          /sbin/ifconfig ${1} ${IPADDR[$i]} broadcast ${BROADCAST[$i]} netmask ${NETMASK[$i]}
        else
          if [ "$DEBUG_ETH_UP" = "yes" ]; then
            echo "/etc/rc.d/rc.inet1:  ${1} interface is not configured in /etc/rc.d/rc.inet1.conf" | $LOGGER
          fi
        fi
      fi
    else
      if [ "$DEBUG_ETH_UP" = "yes" ]; then
        echo "/etc/rc.d/rc.inet1:  ${1} is already up, skipping" | $LOGGER
      fi
    fi 
  else
    if [ "$DEBUG_ETH_UP" = "yes" ]; then
      echo "/etc/rc.d/rc.inet1:  ${1} interface does not exist (yet)" | $LOGGER
    fi
  fi
}

# Function to take down a network interface:
if_down() {
  # Determine position 'i' of this interface in the IFNAME array:
  i=0
  while [ $i -lt $MAXNICS ]; do
    [ "${IFNAME[$i]}" = "${1}" ] && break
    i=$(($i+1))
  done
  if grep `echo ${1}: | cut -f 1 -d :`: /proc/net/dev 1> /dev/null ; then
    if [ "${USE_DHCP[$i]}" = "yes" ]; then
      echo "/etc/rc.d/rc.inet1:  /sbin/dhcpcd -k -d ${1}" | $LOGGER
      /sbin/dhcpcd -k -d ${1} || /sbin/ifconfig ${1} down
      sleep 1
    else
      echo "/etc/rc.d/rc.inet1:  /sbin/ifconfig ${1} down" | $LOGGER
      /sbin/ifconfig ${1} down
    fi
    if [ -x /etc/rc.d/rc.wireless ]; then
      . /etc/rc.d/rc.wireless ${1} stop # Kill wireless daemons if any.
    fi
  fi
}

#####################
# GATEWAY FUNCTIONS #
#####################

# Function to bring up the gateway if there is not yet a default route:
gateway_up() {
  if ! /sbin/route -n | grep "^0.0.0.0" 1> /dev/null ; then
    if [ ! "$GATEWAY" = "" ]; then
      echo "/etc/rc.d/rc.inet1:  /sbin/route add default gw ${GATEWAY} metric 1" | $LOGGER
      /sbin/route add default gw ${GATEWAY} metric 1 2>&1 | $LOGGER
    fi
  fi
}

# Function to take down an existing default gateway:
gateway_down() {
  if /sbin/route -n | grep "^0.0.0.0" 1> /dev/null ; then
    echo "/etc/rc.d/rc.inet1:  /sbin/route del default" | $LOGGER
    /sbin/route del default
  fi
}

# Function to start the network:
start() {
  lo_up
  for i in ${IFNAME[@]} ; do
    if_up $i
  done
  gateway_up
}

# Function to stop the network:
stop() {
  gateway_down
  for i in ${IFNAME[@]} ; do
    if_down $i
  done
  lo_down
}


############
### MAIN ###
############

case "$1" in
'start') # "start" brings up all configured interfaces:
  start
  ;;
'stop') # "stop" takes down all configured interfaces:
  stop
  ;;
'restart') # "restart" restarts the network:
  stop
  start
  ;;
*_start) # Example: "eth1_start" will start the specified interface 'eth1'
  INTERFACE=`echo $1 | /bin/cut -d '_' -f 1`
  if_up $INTERFACE
  gateway_up
  ;;
*_stop) # Example: "eth0_stop" will stop the specified interface 'eth0'
  INTERFACE=`echo $1 | /bin/cut -d '_' -f 1`
  if_down $INTERFACE
  ;;
*_restart) # Example: "wlan0_restart" will take 'wlan0' down and up again
  INTERFACE=`echo $1 | /bin/cut -d '_' -f 1`
  if_down $INTERFACE
  sleep 1
  if_up $INTERFACE
  gateway_up
  ;;
'up') # "up" does the same thing as "start"
  start
  ;;
'down') # "down" does the same thing as "stop"
  stop
  ;;
*_up) # "*_up" does the same thing as "*_start"
  INTERFACE=`echo $1 | /bin/cut -d '_' -f 1`
  if_up $INTERFACE
  gateway_up
  ;;
*_down) # "*_down" does the same thing as "*_stop"
  INTERFACE=`echo $1 | /bin/cut -d '_' -f 1`
  if_down $INTERFACE
  ;;
*) # The default is to bring up all configured interfaces:
  lo_up
  for i in ${IFNAME[@]} ; do
    if_up $i
  done
  gateway_up
esac

# End of /etc/rc.d/rc.inet1

and lastly here is my rc.wireless file contents
Code:
#!/bin/sh
# /etc/rc.d/rc.wireless
# $Id: rc.wireless,v 1.4 2006/08/15 13:09:01 eha Exp eha $
#
# Wireless network card setup.
#
# This script sets up PCI, USB, and 32-bit Cardbus wireless devices
# NOT 16-bit PCMCIA cards!  Those are configured in /etc/pcmcia/.
# Single parameter to this script is the name of a network interface.
# Normally this script is called from rc.inet1 rather than run
# directly.
#
# This script is a modified '/etc/pcmcia/wireless' script
# 09/apr/2004 by Eric Hameleers
# 16/sep/2004 * Eric Hameleers * Fixed iwspy and iwpriv commands
# 08/apr/2005 * Eric Hameleers * Allow per-interface overrides of the wireless
#                                parameters (see /etc/rc.d/rc.inet1.conf)
# 11/apr/2005 * Eric Hameleers * Tune wpa_supplicant interactions.
# 23/apr/2005 * Eric Hameleers * First configure card with iwconfig,
#                                before starting wpa_supplicant
# 27/apr/2005 * Eric Hameleers * Multiple 'iwpriv $INTERFACE set' commands.
# 14/feb/2006 * Eric Hameleers * Better error messages; alternative way of
#                                getting HWADDR; parametrized WPA_WAIT value.
#                                Don't kill an already running wpa_supplicant.
# 29/apr/2006 * Pat Volkerding * Reverted HWADDR change, since it relies on
#                                a binary (macaddr) that is not built or
#                                installed by default since it is not
#                                compatible with all interfaces.
# 15/aug/2006 * Eric Hameleers * Added missing "" around $ESSID, which broke
#                                ESSIDs that contain a space character.
#

LOGGER=${LOGGER:-cat}

if [ -z $IFNAME ] ; then
  echo "WARNING: The script 'rc.wireless' must be executed by 'rc.inet1'!"  | $LOGGER
  echo "         You should run the command \"/etc/rc.d/rc.inet1 <your_interface>_start\" yourself." | $LOGGER
  return 1 2> /dev/null || exit 1
fi

INTERFACE=$1

# Find the path where wireless tools are installed
for IWPATH in /usr/{bin,sbin} /usr/local/{bin,sbin} /sbin /bin ; do
    if [ -x $IWPATH/iwconfig ] ; then break ; fi
done

# The same for wpa_supplicant (needed for WPA support)
for SUPPATH in /usr/{bin,sbin} /usr/local/{bin,sbin} /sbin /bin ; do
    if [ -x $SUPPATH/wpa_supplicant ] ; then break ; fi
done

# Set all desired settings through the wireless tools
IWCOMMAND="$IWPATH/iwconfig ${INTERFACE}"
IWPRIVCMD="$IWPATH/iwpriv ${INTERFACE}"
IWSPYCMD="$IWPATH/iwspy ${INTERFACE}"
IFCOMMAND="/sbin/ifconfig ${INTERFACE}"

is_wireless_device ()
{
    [ -x $IWPATH/iwconfig ] || return 1
    LC_ALL=C $IWPATH/iwconfig $1 2>&1 | \
        grep -Eiq "no wireless extensions|no such device" || return 0
    return 1
}

###############
# EXIT POINTS #
###############

# Is the device wireless?  If not, exit this script.
is_wireless_device ${INTERFACE} || return 0 2> /dev/null || exit 0

# If we stop a wireless interface using wpa_supplicant,
# we'll kill its wpa_supplicant daemon too and exit this script:
if [ "$2" = "stop" ]; then
	WPAPID=`echo \`ps axww|grep wpa_supplicant |grep i${INTERFACE}\` |cut -f1 -d' '`
	[ ${WPAPID} ] &&  kill ${WPAPID}
	return 0
fi

# -----------------------------------------------------
# Continue with the script - bringing the interface UP.
# -----------------------------------------------------

# Bring interface up - for determining the HWADDR
$IFCOMMAND up
sleep 2

# Get the MAC address for the interface
HWADDR=`/sbin/ifconfig ${INTERFACE} | sed -ne 's/.*\(..:..:..:..:..:..\).*/\1/p'`
# Read the configuration information for the card with address $HWADDR
# from /etc/rc.d/rc.wireless.conf:
. /etc/rc.d/rc.wireless.conf

# Let any per-interface overrides (the WLAN_xxxx parameters) that are set
# in /etc/rc.d/rc.inet1.conf have precedence.
# The reason: you might have multiple wireless cards of the same brand, or
# connecting to multiple networks.
# Position 'i' of this interface in the IFNAME array was determined in rc.inet1
CHANNEL=${WLAN_CHANNEL[$i]:-${CHANNEL}}
ESSID=${WLAN_ESSID[$i]:-${ESSID}}
FREQ=${WLAN_FREQ[$i]:-${FREQ}}
FRAG=${WLAN_FRAG[$i]:-${FRAG}}
IWCONFIG=${WLAN_IWCONFIG[$i]:-${IWCONFIG}}
IWPRIV=${WLAN_IWPRIV[$i]:-${IWPRIV}}
IWSPY=${WLAN_IWSPY[$i]:-${IWSPY}}
KEY=${WLAN_KEY[$i]:-${KEY}}
MODE=${WLAN_MODE[$i]:-${MODE}}
NICKNAME=${WLAN_NICKNAME[$i]:-${NICKNAME}}
NWID=${WLAN_NWID[$i]:-${NWID}}
RATE=${WLAN_RATE[$i]:-${RATE}}
RTS=${WLAN_RTS[$i]:-${RTS}}
SENS=${WLAN_SENS[$i]:-${SENS}}
WPA=${WLAN_WPA[$i]:-${WPA}}
WPADRIVER=${WLAN_WPADRIVER[$i]:-${WPADRIVER}}
WPACONF=${WLAN_WPACONF[$i]:-${WPACONF}}
WPAWAIT=${WLAN_WPAWAIT[$i]:-${WPAWAIT}}

[ -n "$VERBOSE" -a -n "$INFO" ] && echo "$0:  $1 is '$INFO'"

###################
# WIRELESS CONFIG #
###################

# Mode needs to be first : some settings apply only in a specific mode!
if [ -n "$MODE" ] ; then
	echo "$0:  $IWCOMMAND mode $MODE" | $LOGGER
	$IWCOMMAND mode $MODE
fi
# This is a bit hackish, but should do the job right...
if [ ! -n "$NICKNAME" ] ; then
    NICKNAME=`/bin/hostname`
fi
if [ -n "$ESSID" -o -n "$MODE" ] ; then
	echo "$0:  $IWCOMMAND nick $NICKNAME" | $LOGGER
	$IWCOMMAND nick $NICKNAME
fi
# Regular stuff...
if [ -n "$NWID" ] ; then
	echo "$0:  $IWCOMMAND nwid $NWID" | $LOGGER
	$IWCOMMAND nwid $NWID
fi
if [ -n "$FREQ" ] ; then
	echo "$0:  $IWCOMMAND freq $FREQ" | $LOGGER
	$IWCOMMAND freq $FREQ
elif [ -n "$CHANNEL" ] ; then
	echo "$0:  $IWCOMMAND channel $CHANNEL" | $LOGGER
	$IWCOMMAND channel $CHANNEL
fi

# WEP keys (non-WPA) 
if [ -n "$KEY" -a ! -n "$WPA" ] ; then
	if [ "$KEY" = "off" ]; then
	  echo "$0:  $IWCOMMAND key open" | $LOGGER
	  $IWCOMMAND key open
	  echo "$0:  $IWCOMMAND key off" | $LOGGER
	  $IWCOMMAND key off
	else 
	  echo "$0:  $IWCOMMAND key restricted" | $LOGGER
	  $IWCOMMAND key restricted
	  echo "$0:  $IWCOMMAND key ************" | $LOGGER
	  $IWCOMMAND key $KEY
	fi
fi
if [ -n "$SENS" ] ; then
	echo "$0:  $IWCOMMAND sens $SENS" | $LOGGER
	$IWCOMMAND sens $SENS
fi
if [ -n "$RATE" ] ; then
	echo "$0:  $IWCOMMAND rate $RATE" | $LOGGER
	$IWCOMMAND rate $RATE
fi
if [ -n "$RTS" ] ; then
	echo "$0:  $IWCOMMAND rts $RTS" | $LOGGER
	$IWCOMMAND rts $RTS
fi
if [ -n "$FRAG" ] ; then
	echo "$0:  $IWCOMMAND frag $FRAG" | $LOGGER
	$IWCOMMAND frag $FRAG
fi
# More specific parameters
if [ -n "$IWCONFIG" ] ; then
	echo "$0:  $IWCOMMAND $IWCONFIG" | $LOGGER
	$IWCOMMAND $IWCONFIG
fi
if [ -n "$IWSPY" ] ; then
	echo "$0:  $IWSPYCMD $IWSPY" | $LOGGER
	$IWSPYCMD $IWSPY
fi
# The iwpriv can set one private IOCTL at the time, so if the $IWPRIV
# variable contqins multiple space separated settings, we split them here:
# WARNING: if your iwpriv commands contain a WEP/WPA key, these can be logged
# in /var/log/messages!
if [ -n "$IWPRIV" ] ; then
	for iwi in $IWPRIV; do
	  echo "$0:  $IWPRIVCMD set $iwi" | $LOGGER
	  $IWPRIVCMD set $iwi
	done
fi

##################
# WPA_SUPPLICANT #
##################

# Support for WPA (wireless protected access) is provided by wpa_supplicant
# for those drivers that support it (and it looks like wpa_supplicant is
# the future for WPA support in Linux anyway)
if [ "$WPA" = "wpa_supplicant" ] || [ "$WPA" = "wpaxsupplicant" ] && [ -x ${SUPPATH}/wpa_supplicant ]; then
	# Interface down, so wpa_supplicant can associate with the AP
	$IFCOMMAND down
	WPACONF=${WPACONF:-/etc/wpa_supplicant.conf}
	WPA_OPTIONS=""
	[ ${WPADRIVER} ] && WPA_OPTIONS="-D${WPADRIVER}" # specify the driver
	[ ${WPA} = "wpaxsupplicant" ] && WPA_OPTIONS="${WPA_OPTIONS} -e" # Use external xsupplicant (disables the internal supplicant)

	# We leave a running wpa_supplicant process in peace:
	WPAPID=`echo \`ps axww|grep wpa_supplicant |grep i${INTERFACE}\` |cut -f1 -d' '`
	if [ ${WPAPID} ]; then
	  echo "$0:  wpa_supplicant found running already" | $LOGGER
	else
	  echo "$0:  wpa_supplicant -Bw -c${WPACONF} ${WPA_OPTIONS} -i$INTERFACE" | $LOGGER
	${SUPPATH}/wpa_supplicant  -c${WPACONF} ${WPA_OPTIONS} -Bw -i$INTERFACE  	 
	fi

	# Buy wpa_supplicant some time to authenticate before bringing the
	# interface back up... but we don't wait forever:
	# You can increase this value in rc.inet1.conf (WLAN_WPAWAIT) or rc.wireless.conf (WPAWAIT)
        # if your card takes longer to associate:
	WPAWAIT=${WPAWAIT:-10}
	wi=0
	while [ $wi -lt $WPAWAIT ]; do
	  wi=$(($wi+1)); sleep 1
	  if (grep -q "^ctrl_interface=" ${WPACONF}); then
	    if (LC_ALL=C ${SUPPATH}/wpa_cli -i$INTERFACE status|grep -q "^wpa_state=COMPLETED"); then break; fi
	  else
	    if (LC_ALL=C ${IWCOMMAND}|grep -Eq "Encryption key:....-"); then break; fi
	  fi
	done
	if [ $wi -eq $WPAWAIT ]; then
	  echo "WPA authentication did not complete, try running '/etc/rc.d/rc.inet1 ${INTERFACE}_start' in a few seconds." | $LOGGER
	fi
	# Bring interface up to avoid 'not ready' errors when calling iwconfig
	$IFCOMMAND up
	sleep 1

else

	# ESSID need to be last: most devices re-perform the scanning/discovery
	# when this is set, and things like encryption keys had better be
	# defined if we want to discover the right set of APs/nodes.
	# NOTE: when automatic association does not work, but you manage to get
	# an IP address by manually setting the ESSID and then calling dhcpcd,
	# then the cause might be the incorrect definition of your ESSID="bla"
	# parameter in rc.wireless.conf.
	# Debug your wireless problems by running 'iwevent' while the card
	# is being configured.
	if [ -n "$ESSID" ] ; then
	  echo "$0:  $IWCOMMAND essid \"$ESSID\"" | $LOGGER
	  $IWCOMMAND essid "$ESSID"
	fi

fi


Any and ALL help is greatly appreciated. I just want the link to come up on its own. Like I mentioned before, I can get it to work manually... weird.

Robert
 
Old 12-28-2006, 09:34 AM   #2
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
I had that problem for a while on my Fedora system. I played around a bit with the links from /etc/rc.d/rc.5 to the wpa_supplicant init file in /etc/init.d, but, if I recall correctly, I fixed the problem by turning off the wpa_supplicant service start-up.

It turned out that wpa_supplicant was being started by, I think, NetworkManager without it checking if it was already running resulting in multiple instances (and failure).

Last edited by PTrenholme; 12-29-2006 at 06:10 AM.
 
Old 12-28-2006, 03:26 PM   #3
lucasrj
LQ Newbie
 
Registered: Apr 2004
Posts: 22

Original Poster
Rep: Reputation: 0
Hello, thanks for the response. Unfortunantly, I do not have a rc.5 file in my /etc/rc.d directory. I looked through all the script files to try to figure out how wap_suplicant gets invoked twice (thus not working, because the 2nd invokation craps out the 1st so none work right). The only script in the /etc/rc.d directory that ever calls on the wpa_suplicant binary file is the rc.wireless script (which I provided the contents in my original post).

I am not using Networkmanager, my box does not start the X gui program automatically. I let its boot to a command prompt 1st.

Again, I can kill the two wpa_suplicant pids, and re-run rd.inet1 which will then only call on wpa_suplicant once. At least I can connect wirelessly via WPA but it sure be nice to do it from boot-up with no intervention on my part.

here is my rc.inetd file
Code:
#!/bin/sh
# Start/stop/restart inetd, the BSD Internet super-daemon.

# Start inetd:
inetd_start() {
  if [ -x /usr/sbin/inetd ]; then
    echo "Starting Internet super-server daemon:  /usr/sbin/inetd"
    /usr/sbin/inetd
  fi
}

# Stop inetd:
inetd_stop() {
  killall inetd
}

# Restart inetd:
inetd_restart() {
  inetd_stop
  sleep 1
  inetd_start
}

case "$1" in
'start')
  inetd_start
  ;;
'stop')
  inetd_stop
  ;;
'restart')
  inetd_restart
  ;;
*)
  echo "usage $0 start|stop|restart"
esac

and here is my rc.M file
Code:
#!/bin/sh
#
# rc.M		This file is executed by init(8) when the system is being
#		initialized for one of the "multi user" run levels (i.e.
#		levels 1 through 6).  It usually does mounting of file
#		systems et al.
#
# Version:	@(#)/etc/rc.d/rc.M	2.23	Wed Feb 26 19:20:58 PST 2003
#
# Author:	Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
#		Heavily modified by Patrick Volkerding <volkerdi@slackware.com>
#

# Tell the viewers what's going to happen.
echo "Going multiuser..."

# Screen blanks after 15 minutes idle time, and powers down in one hour
# if the kernel supports APM or ACPI power management:
/bin/setterm -blank 15 -powersave powerdown -powerdown 60

# Set the hostname.
if [ -r /etc/HOSTNAME ]; then
  /bin/hostname $(cat /etc/HOSTNAME | cut -f1 -d .)
else
  # fall back on this old default:
  echo "darkstar.example.net" > /etc/HOSTNAME
  /bin/hostname darkstar
fi

# Save the contents of 'dmesg':
/bin/dmesg -s 65536 > /var/log/dmesg

# If we are returning from single-user mode we will need to restart
# udevd on systems that use udev:
if ! ps axc | grep -wq udevd ; then
  if grep -wq sysfs /proc/mounts && grep -wq tmpfs /proc/filesystems ; then
    if ! grep -wq nohotplug /proc/cmdline ; then
      if [ -x /etc/rc.d/rc.udev ]; then
        /bin/sh /etc/rc.d/rc.udev start
        /bin/sh /lib/udev/udev.count_events.sh
      fi
    fi
  fi
fi

# Start the system logger.
if [ -x /etc/rc.d/rc.syslog -a -x /usr/sbin/syslogd -a -d /var/log ]; then
  . /etc/rc.d/rc.syslog start
fi

# Initialize PCMCIA devices:
#
# NOTE: This used to be started near the top of rc.S so that PCMCIA devices
# could be fsck'ed along with the other drives.  This had some unfortunate
# side effects, however, since root isn't yet read-write, and /var might not
# even be mounted the .pid files can't be correctly written in /var/run and
# the pcmcia system can't be correctly shut down.  If you want some PCMCIA
# partition to be mounted at boot (or when the card is inserted) then add
# the appropriate lines to /etc/pcmcia/scsi.opts.
#
# Note that the stuff in /etc/pcmcia/ is only for 2.4.x kernels using
# 16-bit PCMCIA cards (not 32-bit Cardbus cards!).  For example, with a
# wireless card you might need to set options in /etc/pcmcia OR in
# /etc/rc.d/rc.wireless.conf, or even in /etc/rc.d/rc.inet1.conf (with
# extra options if needed for the encryption key, ESSID, etc.)
#
# Hopefully this situation will be unified in the future, but for now
# that's how it is...
#
if [ -x /etc/rc.d/rc.pcmcia ]; then
  . /etc/rc.d/rc.pcmcia start
  # The cards might need a little extra time here to initialize.
  if [ -r /var/run/cardmgr.pid ]; then
    sleep 5
  fi
fi

# Initialize the networking hardware.
if [ -x /etc/rc.d/rc.inet1 ]; then
  . /etc/rc.d/rc.inet1
fi

# Initialize the hotplugging subsystem for Cardbus, IEEE1394, PCI, and
# USB devices.  On a 2.4.x kernel this will run the old hotplug system
# started with /etc/rc.d/rc.hotplug.  On a newer kernel, hotplugging
# will be handled by udev.  If you run a 2.6+ kernel, don't shut off
# udev unless you also don't want hotplugging support.
if cat /proc/mounts | grep -wq sysfs ; then
  if ! grep -wq nohotplug /proc/cmdline ; then
    if [ -x /etc/rc.d/rc.udev ]; then
      if [ -d /dev/.udev/failed ]; then
       for i in /dev/.udev/failed/*; do
         echo "add" > "${i}/uevent"
       done
      fi
    elif [ -x /etc/rc.d/rc.hotplug ]; then
      . /etc/rc.d/rc.hotplug start
    fi
  fi
elif [ -x /etc/rc.d/rc.hotplug -a -w /proc/sys/kernel/hotplug ]; then
  if ! grep -wq nohotplug /proc/cmdline ; then
    . /etc/rc.d/rc.hotplug start
  fi
fi

# Look for additional USB/SCSI/IEEE1394/etc devices on multiple LUNs:
if [ -x /etc/rc.d/rc.scanluns ]; then
  . /etc/rc.d/rc.scanluns
fi

# Start networking daemons:
if [ -x /etc/rc.d/rc.inet2 ]; then
  . /etc/rc.d/rc.inet2
fi

# Remove stale locks and junk files (must be done after mount -a!)
/bin/rm -f /var/lock/* /var/spool/uucp/LCK..* /tmp/.X*lock /tmp/core /core 2> /dev/null

# Remove stale hunt sockets so the game can start.
if [ -r /tmp/hunt -o -r /tmp/hunt.stats ]; then
  echo "Removing your stale hunt sockets from /tmp."
  /bin/rm -f /tmp/hunt*
fi

# Ensure basic filesystem permissions sanity.
chmod 755 / 2> /dev/null
chmod 1777 /tmp /var/tmp

# Update all the shared library links:
if [ -x /sbin/ldconfig ]; then
  echo "Updating shared library links:  /sbin/ldconfig"
  /sbin/ldconfig
fi

# Update the X font indexes:
if [ -x /usr/X11R6/bin/fc-cache ]; then
  echo "Updating X font indexes:  /usr/X11R6/bin/fc-cache"
  /usr/X11R6/bin/fc-cache
fi

# Start dnsmasq, a simple DHCP/DNS server:
if [ -x /etc/rc.d/rc.dnsmasq ]; then
  /etc/rc.d/rc.dnsmasq start
fi

# Start the print spooling system.  This will usually be LPRng (lpd) or CUPS.
if [ -x /etc/rc.d/rc.cups ]; then
  # If HPLIP (HP's complete print/scan/fax system) is installed,
  # then it should be run first:
  if [ -x /etc/rc.d/rc.hplip ]; then
    # Start HPLIP:
    /etc/rc.d/rc.hplip start
  fi
  # Start CUPS:
  /etc/rc.d/rc.cups start
elif [ -x /etc/rc.d/rc.lprng ]; then
  # Start LPRng (lpd):
  . /etc/rc.d/rc.lprng start
fi

# Start netatalk. (a file/print server for Macs using Appletalk)
if [ -x /etc/rc.d/rc.atalk ]; then
  /etc/rc.d/rc.atalk
fi

# Start smartd, which monitors the status of S.M.A.R.T. compatible
# hard drives and reports any problems.  Note some devices (which aren't
# smart, I guess ;) will hang if probed by smartd, so it's commented out
# by default.
#if [ -x /usr/sbin/smartd ]; then
#  /usr/sbin/smartd
#fi

# If we're using udev, make /dev/cdrom and any other optical drive symlinks
# if some udev rule hasn't made them already:
if cat /proc/mounts | grep -wq sysfs && cat /proc/filesystems | grep -wq tmpfs ; then
  if ! grep -wq nohotplug /proc/cmdline ; then
    if [ -x /lib/udev/rc.optical-symlinks -a -x /etc/rc.d/rc.udev ]; then
      /bin/sh /lib/udev/rc.optical-symlinks
    fi
  fi
fi

# Monitor the UPS with genpowerd.
# To use this, uncomment this section and edit your settings in
# /etc/genpowerd.conf (serial device, UPS type, etc).  For more information,
# see "man genpowerd" or the extensive documentation in the
# /usr/doc/genpower-1.0.3 directory.
# You'll also need to configure a similar block in /etc/rc.d/rc.6 if you want
# support for stopping the UPS's inverter after the machine halts.
#if [ -x /sbin/genpowerd ]; then
#  echo "Starting genpowerd daemon..."
#  /sbin/genpowerd
#fi

# Turn on process accounting.  To enable process accounting, make sure the
# option for BSD process accounting is enabled in your kernel, and then
# create the file /var/log/pacct (touch /var/log/pacct).  By default, process
# accounting is not enabled (since /var/log/pacct does not exist).  This is
# because the log file can get VERY large.
if [ -x /sbin/accton -a -r /var/log/pacct ]; then
  /sbin/accton /var/log/pacct
  chmod 640 /var/log/pacct
  echo "Process accounting turned on."
fi

# Start crond (Dillon's crond):
# If you want cron to actually log activity to /var/log/cron, then change
# -l10 to -l8 to increase the logging level.
if [ -x /usr/sbin/crond ]; then
  /usr/sbin/crond -l10 >>/var/log/cron 2>&1
fi

# Start atd (manages jobs scheduled with 'at'):
if [ -x /usr/sbin/atd ]; then
  /usr/sbin/atd -b 15 -l 1
fi

# Slackware-Mini-Quota-HOWTO:
# To really activate quotas, you'll need to add 'usrquota' and/or 'grpquota' to
# the appropriate partitions as listed in /etc/fstab.  Here's an example:
#
# /dev/hda2      /home      ext3     defaults,usrquota      1   1
#
# You'll then need to setup initial quota files at the top of the partitions
# to support quota, like this:
# touch /home/aquota.user /home/aquota.group
# chmod 600 /home/aquota.user /home/aquota.group
#
# Then, reboot to activate the system.
# To edit user quotas, use 'edquota'.  See 'man edquota'.  Also, the
# official Quota Mini-HOWTO has lots of useful information.  That can be found
# here:  /usr/doc/Linux-HOWTOs/Quota

# Check quotas and then turn quota system on:
if grep -q quota /etc/fstab ; then
  if [ -x /sbin/quotacheck ]; then
    echo "Checking filesystem quotas:  /sbin/quotacheck -avugm"
    /sbin/quotacheck -avugm
  fi
  if [ -x /sbin/quotaon ]; then
    echo "Activating filesystem quotas:  /sbin/quotaon -avug"
    /sbin/quotaon -avug
  fi
fi

# Start the SASL authentication server.  This provides SASL
# authentication services for sendmail:
if [ -x /etc/rc.d/rc.saslauthd ]; then
  . /etc/rc.d/rc.saslauthd start
fi

# Start the sendmail daemon:
if [ -x /etc/rc.d/rc.sendmail ]; then
  . /etc/rc.d/rc.sendmail start
fi

# Start APM or ACPI daemon.
# If APM is enabled in the kernel, start apmd:
if [ -e /proc/apm ]; then
  if [ -x /usr/sbin/apmd ]; then
    echo "Starting APM daemon:  /usr/sbin/apmd"
    /usr/sbin/apmd
  fi
elif [ -x /etc/rc.d/rc.acpid ]; then # otherwise, start acpid:
  . /etc/rc.d/rc.acpid start
fi

# Load ALSA (sound) defaults:
if [ -x /etc/rc.d/rc.alsa ]; then
  . /etc/rc.d/rc.alsa
fi

# Load a custom screen font if the user has an rc.font script.
if [ -x /etc/rc.d/rc.font ]; then
  . /etc/rc.d/rc.font
fi

# Load a custom keymap if the user has an rc.keymap script.
if [ -x /etc/rc.d/rc.keymap ]; then
  . /etc/rc.d/rc.keymap
fi

# Start the MySQL database:
if [ -x /etc/rc.d/rc.mysqld ]; then
  . /etc/rc.d/rc.mysqld start
fi

# Start Apache web server:
if [ -x /etc/rc.d/rc.httpd ]; then
  . /etc/rc.d/rc.httpd start
fi

# Start OpenLDAP:
if [ -x /etc/rc.d/rc.openldap ]; then
  . /etc/rc.d/rc.openldap start
fi

# Start Samba (a file/print server for Win95/NT machines).
# Samba can be started in /etc/inetd.conf instead.
if [ -x /etc/rc.d/rc.samba ]; then
  . /etc/rc.d/rc.samba start
fi

# Start the GPM mouse server:
if [ -x /etc/rc.d/rc.gpm ]; then
  . /etc/rc.d/rc.gpm start
fi

# If there are SystemV init scripts for this runlevel, run them.
if [ -x /etc/rc.d/rc.sysvinit ]; then
  . /etc/rc.d/rc.sysvinit
fi

# Start the local setup procedure.
if [ -x /etc/rc.d/rc.local ]; then
  . /etc/rc.d/rc.local
fi

# All done.

Thanks again for the help

Robert
 
Old 12-29-2006, 08:27 AM   #4
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
OK, it looks like SuSE uses different initialization methods than Fedora.

But you may, in any case, have the "wpa_supplicant started by two different programs" problem that I had.

So, how does SuSE start the various services and drivers used by the system?
How did you install wpa_supplicant?
What scripts did the installation run, and what files did those scripts modify?

I suspect that one of those modifications set it to be run as a service during startup, and that you should try disabling running wpa_supplicant as a service.

I just looked at the rc.wireless script you posted, above, and saw that the wpa_supplicant section is checking for a running wpa_supplicant before trying to start it, so that shouldn't be your problem. That script, though, relies on rc.wireless.conf, which you didn't post. (And, if it contains your keys, you shouldn't post it.) You might want to review its contents.

I also just now looked at the Fedora wpa_supplicant init script, and noticed that it does not include any check for a running wpa_supplicant, so you might consider reviewing that script on your system, and adding a check. Or you could hack it by renaming the wpa_supplicant executable (in /usr/sbin/wpa_supplicant on my system) and writing a script to check before starting and only run the (renamed) program if it's not already started.

<rant>
And, since you're using an older SuSE release, you might want to consider changing to a newer distribution, not provided by Novell. Novell's recent decision to "cross-license" its patents with Microsoft, but only for "paying customers" has, arguably, put Novell in violation of the GPL. And it has certainly violated the "spirit" of the GPL.

Supporting Novell by using their distributions is, in my opinion, somewhat sleazy.
</rant>
 
Old 12-29-2006, 10:28 AM   #5
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Quote:
Originally Posted by PTrenholme
OK, it looks like SuSE uses different initialization methods than Fedora.

...

<rant>
And, since you're using an older SuSE release, you might want to consider changing to a newer distribution, not provided by Novell. Novell's recent decision to "cross-license" its patents with Microsoft, but only for "paying customers" has, arguably, put Novell in violation of the GPL. And it has certainly violated the "spirit" of the GPL.

Supporting Novell by using their distributions is, in my opinion, somewhat sleazy.
</rant>
Two remarks:

(1) If you read the original post better ("I am running the current version of SLAMD64") you would have noticed that we're talking about a Slackware for AMD64 here, not SuSE.

(2) The rant about Novell is totally uncalled for. Save that for something like an "advocacy" forum, not the Slackware forum.

Eric
 
Old 12-29-2006, 10:32 AM   #6
lucasrj
LQ Newbie
 
Registered: Apr 2004
Posts: 22

Original Poster
Rep: Reputation: 0
Hello. Thanks for the reply. Firstly I want to apologize about the confusion of which distro I am using. My profile says one thing, but I am acutally posting a problem I am encountering using Slamd64 (an "unofficial" port of Slackware). I did mention I was using Slamd64 in my original post. Sorry =(


Quote:
So, how does SuSE start the various services and drivers used by the system?
Slamd64 starts its services just any other Slackware build. rc.M calls on rc.inet1, and rc.inet1 calls on rc.wireless
I have provided copies of all three of those files for review.


Quote:
How did you install wpa_supplicant?
I downloaded the source code, and installed it via the make and make install routine. I did not build a package first and install it as a package.
I just want to note that WPA in itself does work.


Quote:
What scripts did the installation run, and what files did those scripts modify?
According to the Makefile file that came with wpa_suplicant, the "make install" command just puts the binary files into /usr/local/sbin directory.


Quote:
I just looked at the rc.wireless script you posted, above, and saw that the wpa_supplicant section is checking for a running wpa_supplicant before trying to start it, so that shouldn't be your problem. That script, though, relies on rc.wireless.conf, which you didn't post. (And, if it contains your keys, you shouldn't post it.) You might want to review its contents.
As requested, here is a copy of my rc.wireless.conf file. The actual key that I use for WPA is stored in the /etc/wpa_supplicant.conf file

Code:
# Wireless LAN adapter configuration
#
# Theory of operation : 
#
# The script attempts to match a block of settings to the specific wireless
# card inserted, the *first* block matching the card is used.
# The address format is "hwaddr", with * as a wildcard.
# 'hwaddr' is the unique MAC address identifier of the wireless card.
# The MAC address is usually printed on the card, or can be found via ifconfig.
# Some examples here use only half of the MAC address with a wildcard to
# match a whole family of cards...
#
# All the Wireless specific configuration is done through the Wireless
# Extensions, so we will just call 'iwconfig' with the right parameters
# defined below.
# Of course, you need to have iwconfig installled on your system.
# To download iwconfig, or for more info on Wireless Extensions :
#	http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html
#
# Note : you don't need to fill all parameters, leave them blank, in most
# cases the driver will initialise itself with sane defaults values or
# automatically figure out the value... And no drivers do support all
# possible settings...
#
# -- This is a modified '/etc/pcmcia/wireless.opts' script --
# -- I added sections for Prism/GT and Atheros based cards --
# --    (supported by the prism54 and madwifi drivers)     --
# --              16/sep/2004 * Eric Hameleers             --
#

VERBOSE=1

case "$HWADDR" in



# Generic example (decribe all possible settings)
*)
    INFO="Fill with your own settings..."
    # ESSID (extended network name) : My Network, any
    ESSID=""
    # NWID/Domain (cell identifier) : 89AB, 100, off
    NWID=""
    # Operation mode : Ad-Hoc, Managed, Master, Repeater, Secondary, auto
    MODE=""
    # Frequency or channel : 1, 2, 3 (channel) ; 2.422G, 2.46G (frequency)
    FREQ=""
    CHANNEL=""
    # Sensitivity (cell size + roaming speed) : 1, 2, 3 ; -70 (dBm)
    SENS=""
    # Bit rate : auto, 1M, 11M
    RATE=""
    # Encryption key : 4567-89AB-CD, s:password
    KEY=""
    # RTS threshold : off, 500
    RTS=""
    # Fragmentation threshold : off, 1000
    FRAG=""
    # Other iwconfig parameters : power off, ap 01:23:45:67:89:AB
    IWCONFIG=""
    # iwspy parameters : + 01:23:45:67:89:AB
    IWSPY=""
    # iwpriv parameters : set_port 2, set_histo 50 60
    IWPRIV=""
    ;;
esac

Here's what gets me. If you take a look at the timestamps of when the two wpa_supplicants running from the /var/messages file I posted previously, you'll notice that they were run at the same time. Also, you'll notive from the the results of ps -ax show that thier PIDS are only 1 number off from each other.

It is my speculation that the built-in wireless card hasn't fully initialized after the ndiswrapper module installs. I have played around with delays and whatnot, but wpa_supplicant always manages to get loaded twice when my laptop botts up. It still doesnt explain how wpa_supplicant gets called twice at the same time, but would explain why it gets called once after I run "/etc/rc.d/rc.inet1 -restart" and actually works (after I kill the previous two invokations of course)

Anyway, I appreciate you taking the time to look at this with me =)

Robert
 
Old 12-29-2006, 02:56 PM   #7
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
First, sorry for the rant. I'd read your "Distribution: SUSE 9.2" and didn't notice that this thread was in the Slack forum 'till after my last post. My excuse is that I'd just finished reading some new posts in the GrokLaw forum, and was feeling "rantish."

As to your problem:

First, consider the wpa_supplicant section of rc.wireless
Code:
##################
# WPA_SUPPLICANT #
##################

# Support for WPA (wireless protected access) is provided by wpa_supplicant
# for those drivers that support it (and it looks like wpa_supplicant is
# the future for WPA support in Linux anyway)
if [ "$WPA" = "wpa_supplicant" ] || [ "$WPA" = "wpaxsupplicant" ] && [ -x ${SUPPATH}/wpa_supplicant ]; then
    # Interface down, so wpa_supplicant can associate with the AP
    $IFCOMMAND down
    WPACONF=${WPACONF:-/etc/wpa_supplicant.conf}
    WPA_OPTIONS=""
    [ ${WPADRIVER} ] && WPA_OPTIONS="-D${WPADRIVER}" # specify the driver
    [ ${WPA} = "wpaxsupplicant" ] && WPA_OPTIONS="${WPA_OPTIONS} -e" # Use external xsupplicant (disables the internal supplicant)

    # We leave a running wpa_supplicant process in peace:
    WPAPID=`echo \`ps axww|grep wpa_supplicant |grep i${INTERFACE}\` |cut -f1 -d' '`
    if [ ${WPAPID} ]; then
      echo "$0:  wpa_supplicant found running already" | $LOGGER
    else
      echo "$0:  wpa_supplicant -Bw -c${WPACONF} ${WPA_OPTIONS} -i$INTERFACE" | $LOGGER
    ${SUPPATH}/wpa_supplicant  -c${WPACONF} ${WPA_OPTIONS} -Bw -i$INTERFACE       
    fi

    # Buy wpa_supplicant some time to authenticate before bringing the
    # interface back up... but we don't wait forever:
    # You can increase this value in rc.inet1.conf (WLAN_WPAWAIT) or rc.wireless.conf (WPAWAIT)
        # if your card takes longer to associate:
    WPAWAIT=${WPAWAIT:-10}
    wi=0
    while [ $wi -lt $WPAWAIT ]; do
      wi=$(($wi+1)); sleep 1
      if (grep -q "^ctrl_interface=" ${WPACONF}); then
        if (LC_ALL=C ${SUPPATH}/wpa_cli -i$INTERFACE status|grep -q "^wpa_state=COMPLETED"); then break; fi
      else
        if (LC_ALL=C ${IWCOMMAND}|grep -Eq "Encryption key:....-"); then break; fi
      fi
    done
    if [ $wi -eq $WPAWAIT ]; then
      echo "WPA authentication did not complete, try running '/etc/rc.d/rc.inet1 ${INTERFACE}_start' in a few seconds." | $LOGGER
    fi
    # Bring interface up to avoid 'not ready' errors when calling iwconfig
    $IFCOMMAND up
    sleep 1
In the extract of /var/log/messages you posted above, we find:
Quote:
Dec 27 16:29:51 deepthought logger: /etc/rc.d/rc.M: wpa_supplicant -Bw -c/etc/wpa_supplicant.conf -Dwext -iwlan0
Dec 27 16:29:51 deepthought logger: /etc/rc.d/rc.inet1: wpa_supplicant -Bw -c/etc/wpa_supplicant.conf -Dwext -iwlan0
Dec 27 16:30:02 deepthought logger: WPA authentication did not complete, try running '/etc/rc.d/rc.inet1 wlan0_start' in a few seconds.
Dec 27 16:30:02 deepthought logger: WPA authentication did not complete, try running '/etc/rc.d/rc.inet1 wlan0_start' in a few seconds.
So rc.wireless has been called twice, once from rc.M and once from rc.inet1. Why?

Consider the value of WPAWAIT used in the extract above. If that value is too small, the wpa_supplicant process will not have enough time to start before before the second call hits the same section of code. Try setting the value to, say, 30 seconds in one of the two places suggested in the code fragment quoted above. Looking at your rc.wireless.conf file, it appears that you have not set any values in that configuration file, so I suppose the defaults work for you. But adding a WPAWAIT=30 might help.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Autoconnect to AP with wpa_supplicant at boot android6011 Linux - Networking 2 09-15-2006 07:51 PM
How to Starting WPA_Supplicant on boot? SmileZero Linux - Wireless Networking 5 10-01-2005 11:21 PM
starting wpa_supplicant at boot mdj Linux - Wireless Networking 1 03-03-2005 10:41 PM
installed dropline, root loads kde3.2, user loads drop pgrimes Linux - Software 7 06-28-2004 06:11 PM
Which file loads at boot time? plm Slackware 9 12-26-2003 12:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration