Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 153297

Summary: net.wlan0 init.d script tries to start wpa_cli but fails (wpa_ctrl_open)
Product: Gentoo Linux Reporter: TBeck <toby.beck>
Component: Current packagesAssignee: Roy Marples (RETIRED) <uberlord>
Status: RESOLVED FIXED    
Severity: normal CC: seventhguardian
Priority: High    
Version: 2006.1   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: my wpa_supplicant configuration file

Description TBeck 2006-10-29 07:30:50 UTC
Portage 2.1.1 (default-linux/x86/2006.1, gcc-4.1.1, glibc-2.4-r3, 2.6.17-gentoo-r8 i686)
=================================================================
System uname: 2.6.17-gentoo-r8 i686 Intel(R) Pentium(R) M processor 1.60GHz
Gentoo Base System version 1.12.5
Last Sync: Sun, 29 Oct 2006 12:50:01 +0000
ccache version 2.3 [disabled]
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: 1.3.7, 2.0.30
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.3
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r4
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium-m -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/initng/daemon /etc/initng/net /etc/initng/system /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -march=pentium-m -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer parallel-fetch sandbox sfperms strict"
GENTOO_MIRRORS="http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://ftp.join.uni-muenster.de/pub/linux/distributions/gentoo http://ftp.uni-erlangen.de/pub/mirrors/gentoo http://mirror.uni-c.dk/gentoo/ http://gentoo.math.bme.hu ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror"
LINGUAS=""
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /usr/local/initng-portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="x86 X X509 aac acpi aim alsa amarok arts bash-completion bitmap-fonts bittorrent bzip2 calendar cardbus ccache cdb cdda cddb cdparanoia cdr cdrom cdsound chroot connectionstatus contactnotes cracklib crypt css curl de_tvtoday dga diet directfb divx dlopen dri dts dv dvd dvdr dvdread ecc elibc_glibc encode enscript exif exscalibar fat fbcon fbdev fbsplash ffmpeg firefox flac foomaticdb fortran fping ftp fuse gdb gdbm gif gimp gimpprint gmail gmedia gphoto2 gpm gstreamer gtalk hal hash haskell hbci history hpn ibam iconv icq icu id3 ieee1394 imagemagick imap imlib initng_plugins_also initng_plugins_bash_launcher initng_plugins_chdir initng_plugins_chroot initng_plugins_conflict initng_plugins_cpout initng_plugins_critical initng_plugins_ctrlaltdel initng_plugins_daemon_clean initng_plugins_debug_commands initng_plugins_envparser initng_plugins_find initng_plugins_fmon initng_plugins_fstat initng_plugins_history initng_plugins_idleprobe initng_plugins_initctl initng_plugins_interactive initng_plugins_iparser initng_plugins_last initng_plugins_limit initng_plugins_lockfile initng_plugins_logfile initng_plugins_netdev initng_plugins_netprobe initng_plugins_ngc4 initng_plugins_ngcs initng_plugins_nge initng_plugins_pause initng_plugins_provide initng_plugins_reload initng_plugins_renice initng_plugins_rlparser initng_plugins_simple_launcher initng_plugins_stcmd initng_plugins_stdout initng_plugins_suid initng_plugins_syncron initng_plugins_syslog initng_plugins_sysreq initng_plugins_unneeded initng_plugins_usplash input_devices_evdev input_devices_keyboard input_devices_mouse input_devices_synaptics ipod iproute2 ipsec ipv6 irc irda jabber jack java java5 javascript jingle jpeg kde kdeenablefinal kdepim kdm kernel_linux lame latex libg++ libsexy lm_sensors logitech-mouse logrotate lpr lzo lzw lzw-tiff mad maildir memlimit mhash mime mmap mmx mmxext mng mod_irc mozcalendar mp3 mp4 mp4live mpeg mpeg2 mpeg4 mplayer musepack musicbrainz nat ncurses nethack nfs nls nntp nocd nptl nptlonly nsplugin ntfs objc objc++ objc-gc offensive office ogg on-the-fly-crypt opendoc opengl openntpd openssh openssl opensslcrypt oscar pam pam_chroot pcmcia pcre pdf perl php png pop posix ppds print ps python qt3 qt4 quicktime rar raw-mode rc5 rdesktop readline real realmedia reflection rrdtool rss rt2500usb rt73usb rtc rtsp samba screen sdl session sftp sftplogging slang smime smtp sockets sound spell spl sql sse sse-filters sse2 ssl stream subversion swat sysfs syslog tcpd tetex thesaurus threads thunderbird tiff transcode transparent-proxy truetype truetype-fonts type1-fonts udev unicode unzip usb userland_GNU v4l v4l2 vcd vhosts video_cards_ati video_cards_fglrx video_cards_radeon video_cards_vesa vim vlm vnc vncviewer vorbis webpresence wifi win32codecs wireshark wma wmf wmp x264 xface xfs xine xinerama xinetd xml xorg xosd xpm xscreensaver xterm xv xvid zip zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS


-----------------------------------------------------------

Hi, 
i've searched for this but haven't found a solution yet, my problem is:

when booting or manually starting the /etc/init.d/net.wlan0 script, the wpa_supplicant daemon starts but the wpa_cli fails to start and exits with the following message:

Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory  

Following scripts that need the net scripts obviously fail, too. The interface is down and not up once the machine is booted.

if i now kill the running wpa_supplicant and start it manually with:

 wpa_supplicant -Dwext -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -B -W

then start wpa_cli, the interface automatically gets activated and wpa_supplicant associates correctly with my AP.
I now have to manually start the dhcpcd to get my IP via DHCP.

my /etc/conf.d/net file is:


modules_wlan0=( "wpa_supplicant" )
config_wlan0=( "dhcp" )
dhcpcd_wlan0="-N -t 10"


I have traced the problem to the point where the modules are obviously being started in the iface_start() function in the /etc/init.d/net.wlan0 script.
The script starts wpa_supplicant and wpa_cli here:

# pre Start any modules with
        for mod in ${MODULES[@]}; do
                if is_function "${mod}_pre_start" ; then
                        ${mod}_pre_start "${iface}" || { eend 1; return 1; }
                fi
        done

but never reaches the end, because wpa_cli fails to start. I couldn't find out more. If this is only on my setup, could you tell me what might cause this behaviour?
oh, and i'm using  net-wireless/wpa_supplicant-0.5.5 

peace, 
toby
Comment 1 Roy Marples (RETIRED) gentoo-dev 2006-10-29 23:51:20 UTC
Please attach /etc/wpa_supplicant.conf (if exists) AND /etc/wpa_supplicant/wpa_supplicant.conf

Just blank out the passwords/keys, please leave everything else intact.
Comment 2 TBeck 2006-10-30 00:02:49 UTC
Created attachment 100764 [details]
my wpa_supplicant configuration file
Comment 3 Roy Marples (RETIRED) gentoo-dev 2006-10-30 00:08:13 UTC
Do you see this issue with wpa_supplicant-0.5.4?
Comment 4 TBeck 2006-10-30 01:39:14 UTC
Yes, I have the same issue with 0.5.4. Here some more information:

after booting, when i start wpa_cli manually without having changed anything yet, wpa_cli starts and reports this:

<2>CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
<2>Trying to associate with 00:30:f1:db:83:60 (SSID='WLAN' freq=0 MHz)
<2>CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
<2>Trying to associate with 00:15:e9:14:30:aa (SSID='Brunnenstr10' freq=0 MHz)
Comment 5 TBeck 2006-10-31 23:51:05 UTC
after booting, if i set wlan0 up manually with

ip l set wlan 0 up

and then start wpa_cli, wpa_supplicant associates w/o problems
Comment 6 Jakub Moc (RETIRED) gentoo-dev 2007-05-19 19:41:56 UTC
Do you see this issue with wpa_supplicant-0.5.7?
Comment 7 Renato Caldas 2007-05-28 09:36:34 UTC
I'm having the same issue here with baselayout-2.0.0_alpha3, and found the source of the problem. Apparently wpa_cli doesn't respect the -P switch (pid file selection), and start-stop-daemon can't work with it:

$ /etc/init.d/net.eth1 start
(...)
 *   Starting wpa_cli on eth1 ...
+ start-stop-daemon --start --exec /bin/wpa_cli --pidfile /var/run/wpa_cli-eth1.pid -- -a /etc/wpa_supplicant/wpa_cli.sh -p 'DIR=/var/run/wpa_supplicant GROUP=wheel' -i eth1 -P /var/run/wpa_cli-eth1.pid -B
Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory
 *   start-stop-daemon: failed to started `/bin/wpa_cli'
(...)

Manually starting wpa_cli confirms this issue:

$ wpa_cli -P $PWD/test.pid

Result -> No PID file gets created.

I don't know why this is happening, I've had it working with this baselayout just some days ago... So I'm not sure what changed, or if it is a wpa_cli/baselayout bug..

Just to check, was this the way wpa_cli was used in the init scripts before baselayout-2.0.0_alpha3?
Comment 8 Renato Caldas 2007-05-28 09:51:47 UTC
Oh sorry... No, this is not the true issue. It's true that wpa_cli doesn't respect the -P switch, but the true issue is another one:

The -p argument is 'DIR=/var/run/wpa_supplicant GROUP=wheel', which I believe isn't yet supported by wpa_cli-0.5.7.
Comment 9 Roy Marples (RETIRED) gentoo-dev 2007-07-07 23:43:11 UTC
The error "Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory" should be fixed in wpa_supplicant-0.5.8 or at least 0.6.0

Re-open if you dis-agree.