Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 283601 - sys-apps/openrc-0.4.3-r3: networking scripts ignore modules="wpa_supplicant" in /etc/conf.d/net
Summary: sys-apps/openrc-0.4.3-r3: networking scripts ignore modules="wpa_supplicant" ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: x86 Linux
: High major
Assignee: Gentoo Linux bug wranglers
URL: http://forums.gentoo.org/viewtopic-p-...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-03 18:53 UTC by Boney McCracker
Modified: 2009-10-02 11:11 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Boney McCracker 2009-09-03 18:53:09 UTC
wpa_supplicant works flawlessly when invoked from the command line or my workaround initscript, but I can't invoke it using the gentoo networking scripts, which consistently try to form a WEP association instead, regardless of tweaks I've tried in /etc/conf.d/net.  It does not appear to ever call the wpa_supplicant module.

/etc/conf.d/net:
-------------------------------------------------------------------
config_eth0="dhcp"


# wireless

modules="wpa_supplicant"
config_ra0="dhcp"
wpa_supplicant_ra0="-Dwext"
-----------------------------------------------------------------------


Known working wpa_supplicant.conf:
-----------------------------------------------------------------------
#### global configuration

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=0

# delegate scanning to the driver, select by SSID and security policy
ap_scan=2

#### per-essid configuration

network={
        ssid="mynetwork"
        scan_ssid=1
        proto=RSN
        key_mgmt=WPA-PSK
        auth_alg=OPEN
        pairwise=CCMP
        group=CCMP
        #psk="<redacted>"
        psk=<redacted>
        proactive_key_caching=1
}


Reproducible: Always

Steps to Reproduce:
1.  install and configure wpa supplicant
2.  test wpa_supplicant configuration and functions manually
3.  configure conf.d/net and attempt to connect via initscripts

Actual Results:  
typhoon net # /etc/init.d/net.ra0 start
* Bringing up interface ra0
*   Configuring wireless network for ra0
*   Scanning for access points
*     Found "mynetwork" at 00:17:3F:9C:77:42, managed, encrypted
*   WEP key is not set for "mynetwork"
*   Couldn't associate with any access points on ra0
*   Failed to configure wireless for ra0
* ERROR: net.ra0 failed to start

Providing a dummy WEP key merely causes the scripts to continue to attempt (and fail) to form a WEP association.

Expected Results:  
WPA supplicant is started, which then connects normally (as it does when started manually).

typhoon net # emerge --info
Portage 2.1.6.13 (default/linux/x86/2008.0, gcc-4.4.1, glibc-2.10.1-r0, 2.6.30-gentoo-r6 i686)
=================================================================
System uname: Linux-2.6.30-gentoo-r6-i686-Intel-R-_Pentium-R-_4_CPU_1400MHz-with-gentoo-2.0.1
Timestamp of tree: Thu, 03 Sep 2009 08:15:02 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.0_p28
dev-java/java-config: 2.1.9
dev-lang/python:     2.6.2-r1
dev-util/ccache:     2.4-r8
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.4.3-r3
sys-apps/sandbox:    2.1
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.10.2, 1.11
sys-devel/binutils:  2.19.1-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -pipe -fforce-addr -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -march=pentium4 -pipe -fforce-addr -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://ftp.gtlib.gatech.edu/pub/gentoo http://gentoo.osuosl.org/ http://open-systems.ufl.edu/mirrors/gentoo "
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1,--hash-style=gnu"
LINGUAS="en_US en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
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"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="X alsa berkdb bzip2 cairo caps cli consolekit cracklib crypt cups dbus dri exif ffmpeg gdbm gif gpm gtk hal iconv java jpeg lcms mmx mp3 mudflap ncurses nls nptl nptlonly nsplugin ogg opengl openmp pam pcre perl png python readline reflection session spl sse sse2 ssl svg sysfs theora threads tiff truetype unicode vorbis win32codecs x86 xcb xorg xulrunner zlib" ALSA_CARDS="emu10k1" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul 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="evdev" KERNEL="linux" LINGUAS="en_US en" USERLAND="GNU" VIDEO_CARDS="nv"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Boney McCracker 2009-09-03 19:06:31 UTC
Additional info:

typhoon net # emerge -pv openrc wpa_supplicant

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] sys-apps/openrc-0.4.3-r3  USE="ncurses pam unicode -debug" 143 kB
[ebuild   R   ] net-wireless/wpa_supplicant-0.6.9  USE="dbus readline ssl -debug -eap-sim -gnutls -madwifi -ps3 -qt3 -qt4 -wps" 0 kB

Also, I am using the rt2870sta driver (as provided in kernel 2.6.30-gentoo-r6), to which I have added one trivial patch to add hardware identification for my Belkin USB network device.  As I have noted, this all works flawlessly when activated manually.
Comment 2 Boney McCracker 2009-09-03 20:13:53 UTC
Additional info:

Demonstrating that wpa_supplicant functions normally.

This workaround initscript works:
-------------------------------------------------------------------
#!/sbin/runscript

# /etc/init.d/net.ra0

depend() {
        need localmount
        use logger
        after net.lo
        provide net
}

start() {
        ebegin "Starting wireless network connection"
                start-stop-daemon --start \
                  --exec /usr/sbin/wpa_supplicant \
                  --pidfile /var/run/wpa_supplicant-ra0.pid \
                  -- -c /etc/wpa_supplicant/wpa_supplicant.conf \
                  -W -B -i ra0 -P /var/run/wpa_supplicant-ra0.pid
        wpa_cli -i ra0 -B -a /etc/wpa_supplicant/wpa_action.sh
        eend $? "Failed to start wireless network connection"
}

stop() {
        ebegin "Stopping wireless network connection"
                start-stop-daemon --stop \
                        --pidfile /var/run/wpa_supplicant-ra0.pid \
                        --exec /usr/sbin/wpa_supplicant
        eend $? "Failed to stop wireless network connection"
}
----------------------------------------------------------------------

With this accompanying wpa_cli action script (merely to initiate dhcp):
-----------------------------------------------------------------------
#!/bin/sh

# /etc/wpa_supplicant/wpa_action.sh

# Purpose: start and stop dhcp when wpa supplicant emits a
# CONNECTED or DISCONNECTED event. This script is run as a
# daemon along with wpa_supplicant, using the command:
# wpa_cli -a /etc/wpa_supplicant/wpa_action.sh -B

if [ -z "$1" -o -z "$2" ]; then
        logger -t wpa_action "Insufficient parameters"
        exit 1
fi

iface="$1"
event="$2"

case ${event} in
        CONNECTED)
                action="/sbin/dhclient ${iface}"
                ;;
        DISCONNECTED)
                action="/sbin/dhclient -x ${iface}"
                ;;
        *)
                logger -t wpa_action "received bogus wpa_supplicant event: ${event}"
                exit 1
                ;;
esac

${action} || logger -t wpa_action "'${action}' failed"
--------------------------------------------------------------------------

Produces the following results:

# /etc/init.d/net.ra0 start
* Caching service dependencies...                           [ ok ]
* Starting wireless network connection...                   [ ok ]

# wpa_cli status
Selected interface 'ra0'
bssid=00:17:3f:9c:77:42
ssid=mynetwork
id=0
pairwise_cipher=CCMP
group_cipher=CCMP
key_mgmt=WPA2-PSK
wpa_state=COMPLETED
ip_address=192.168.1.30

# iwconfig ra0
ra0       RT2870 Wireless  ESSID:"mynetwork"  Nickname:"RT2870STA"
          Mode:Managed  Frequency=2.412 GHz  Access Point: 00:17:3F:9C:77:42   
          Bit Rate=54 Mb/s   
          RTS thr:off   Fragment thr:off
          Encryption key:<redacted>
          Link Quality=100/100  Signal level:-66 dBm  Noise level:-81 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

So, either I don't understand how to properly set up /etc/conf.d/net, or the networking scripts aren't functioning properly.
Comment 3 Boney McCracker 2009-09-03 21:15:41 UTC
I don't understand this.

As a desperate measure, I tried re-emerging openrc.  And now it's working fine.

This is particularly curious, since I did an 'emerge -e system' and 'emerge -e world' less than a month ago.  I have never edited any of the rc scripts, so I can't imagine why this would be.

At any rate, it now appears to be functioning completely as advertised, with everything unchanged from what I provided as a problematic configuration.

I will leave this open, since I think Roy should see it anyway.  Feel free to handle it as you see fit.
Comment 4 Patrick ALLAERT 2009-10-02 10:42:24 UTC
I am experiencing exactly the same problem on my fresh gentoo install.

Using wpa_supplicant on command line works fine, but it is never called by the initscript.

Using sys-apps/openrc-0.4.3-r3 too.

I will now reemerge openrc to see if it fixes something.
Comment 5 Patrick ALLAERT 2009-10-02 11:11:26 UTC
Reemerging openrc fixed indeed the problem.

I backed up some of the dirs/files installed by openrc and diffing the two shows that I now have a /lib/rc/init.d/daemons/net.eth1/ with two files "001" and "002". There where no such /lib/rc/init.d/daemons/net.eth1/ directory before.

Hope it helps!