I have a problem where the first run of the init script for my laptop's wireless card fails to run, although this only 95% reproducable. Any subsequent run attempt will work. I use wpa_supplicant-0.5.10 with the madwifi-ng-0.9.4 driver. After some testing, I found that there is potential race condition where wpa_cli checks for the socket created by wpa_supplicant. As wpa_cli is called directly after wpa_supplicant, it is possible the socket is not present when wpa_cli looks for it. My solution has been to hack 'wpa_cli' to retry a number of times if not in interactive mode and this has provided a workaround for the problem. I do not know enough about this to state if this is a "good" solution. I stumbled on this workaround when inserting debug printf() into the wpa_cli code, as there were sufficent to cause enough delay for it to work first time.
Portage 2.1.4.4 (default/linux/x86/2008.0/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.25-gentoo-r7 i686) ================================================================= System uname: 2.6.25-gentoo-r7 i686 Intel(R) Pentium(R) M processor 1500MHz Timestamp of tree: Fri, 01 Aug 2008 20:34:01 +0000 app-shells/bash: 3.2_p33 dev-java/java-config: 1.3.7, 2.1.6 dev-lang/python: 2.4.4-r13, 2.5.2-r6 dev-python/pycrypto: 2.0.1-r6 sys-apps/baselayout: 1.12.11.1 sys-apps/sandbox: 1.2.18.1-r2 sys-devel/autoconf: 2.13, 2.61-r2 sys-devel/automake: 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1 sys-devel/binutils: 2.18-r3 sys-devel/gcc-config: 1.4.0-r4 sys-devel/libtool: 1.5.26 virtual/os-headers: 2.6.23-r3 ACCEPT_KEYWORDS="x86" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=pentium4 -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /var/lib/hsqldb" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d" CXXFLAGS="-O2 -march=pentium4 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS="http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo http://gentoo.virginmedia.com/sites/gentoo" LANG="fr_FR@euro" LC_ALL="fr_FR@euro" LDFLAGS="-Wl,-O1" LINGUAS="fr en_GB" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X acl acpi alsa apm berkdb bluetooth branding bzip2 cairo cdr cli cracklib crypt cups dbus dri dvd dvdr dvdread eds emboss encode esd evo fam firefox fortran gdbm gif gnome gpm gstreamer gtk hal howl iconv ipv6 isdnlog java jpeg kerberos ldap libnotify lm_sensors mad madwifi midi mikmod mono mp3 mpeg mudflap ncurses nls no-epiphany no-seamonkey nptl nptlonly ogg opengl openmp pam pcre pdf perl pmu png ppds pppd python qt3support quicktime readline reflection sdl session spell spl ssl startup-notification svg sysfs tcpd tiff truetype type1 unicode usb vorbis win32codecs x86 xml xorg xv zlib" ALSA_CARDS="intel8x0" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="fr en_GB" USERLAND="GNU" VIDEO_CARDS="radeon" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Created attachment 162161 [details, diff] Initial workaround (illustration purposes only)
I verify this problem with every version of wpa_supplicant
i have never hit this particular issue, but is it still a problem?
The laptops which had this problem were both given away about 6 months ago. So I can no longer confirm or deny this as a problem.
Closing as worksforme then