Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 369925 - /etc/conf.d/net - Setting associate_timeout_<iface> does not have any effect with net-wireless/wpa_supplicant
Summary: /etc/conf.d/net - Setting associate_timeout_<iface> does not have any effect ...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: netifrc (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: netifrc Team
URL:
Whiteboard: netifrc:iwconfig
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-03 17:19 UTC by Róbert Čerňanský
Modified: 2014-01-16 20:49 UTC (History)
1 user (show)

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


Attachments
/etc/conf.d/net (file_369925.txt,1.19 KB, text/plain)
2014-01-16 20:48 UTC, Róbert Čerňanský
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Róbert Čerňanský 2011-06-03 17:19:18 UTC
Using module wpa_supplicant to setup wireless wlan0 interface.  Setting a variable in /etc/conf.d/net as follows: 'associate_timeout_wlan0=30' does not have any effect.  When interface net.wlan0 is started it still goes to background immediately.  Dependent services, such as ntp-client, then fails due to inaccessible network.

$ emerge -pv baselayout openrc wpa_supplicant 
...
[ebuild   R   ] net-wireless/wpa_supplicant-0.7.3-r2  USE="dbus gnutls qt4 readline ssl -debug -eap-sim -fasteap -madwifi (-ps3) -wimax -wps" 0 kB
[ebuild   R   ] sys-apps/baselayout-2.0.2  USE="-build" 0 kB
[ebuild   R   ] sys-apps/openrc-0.8.2-r1  USE="ncurses pam unicode -debug (-selinux)" 0 kB


$ emerge --info
Portage 2.1.9.42 (default/linux/amd64/10.0/desktop, gcc-4.4.5, libc-0-r0, 2.6.38-gentoo-r6 x86_64)
=================================================================
System uname: Linux-2.6.38-gentoo-r6-x86_64-Mobile_AMD_Sempron-tm-_Processor_3500+-with-gentoo-2.0.2
Timestamp of tree: Thu, 02 Jun 2011 05:00:01 +0000
distcc 3.1 x86_64-pc-linux-gnu [enabled]
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11-r3
dev-lang/python:     2.7.1-r1, 3.1.3-r1
dev-util/cmake:      2.8.4-r1
sys-apps/baselayout: 2.0.2
sys-apps/openrc:     0.8.2-r1
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.65-r1
sys-devel/automake:  1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.5
sys-devel/gcc-config: 1.4.1-r1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.82
sys-kernel/linux-headers: 2.6.36.1
sys-libs/glibc:      2.12.2
virtual/os-headers:  0
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA RTCW RTCW-ETEULA DOOM3 ut2003 Q3AEULA LOKI-EULA ETQW QUAKE4 Introversion dlj-1.1 googleearth AdobeFlash-10 AdobeFlash-10.1 PUEL"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=k8-sse3 -msahf --param l1-cache-size=64 --param l1-cache-line-size=64 --param l2-cache-size=512 -fweb -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
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/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=k8-sse3 -msahf --param l1-cache-size=64 --param l1-cache-line-size=64 --param l2-cache-size=512 -fweb -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distcc distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="ftp://mirror.gentoo.sk http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,--sort-common"
LINGUAS="en sk cs ru"
MAKEOPTS="-j3"
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="/var/lib/layman/sunrise /var/lib/layman/autoarchive /var/lib/layman/dottout /stuff/reserve/install/portage/hs"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="256-color 3dnow 3dnowext 7zip X Xaw3d a52 aac aalib acl acpi adplug ads aim alsa amd64 amr amrnb amrwb ares aspell audacious bash-completion bdf berkdb binfilter bittorrent blender-game bluetooth branding bzip2 cairo caps cdda cddb cdinstall cdparanoia cdr cli cracklib crypt css cue cups custom-optimization cxx daemon dbus dga divx djvu dri dssi dts dv dvd dvdnav dvdr editor emacs emboss enblend encode exif expat fading-colors fbcon fbcondecor ffmpeg firefox flac flash font-server font-styles fontconfig foomaticdb fortran freesound ftp gd gdbm gif gimp gimpprint glade gmedia gnutella gnutls gpg gphoto2 gpm gs gtk gtkhtml guile gzip-el hddtemp hdri hou iconv icq id3tag idn ilbc imagemagick imap imlib ipv6 jabber jack javascript jbig jpeg jpeg2k kdrive kerberos kqemu ladcca ladspa lcms ldap leim libcaca libnotify live lm_sensors logrotate lua-cairo lzma mad maildir matroska memlimit mercurial midi mime mjpeg mms mmx mmxext mng modplug modules mono mp2 mp3 mp4 mpeg mplayer msn mtp mudflap mule multilib musepack musicbrainz ncurses nemesi network networking new-login nls nocd nowin nptl nptlonly nsplugin nut ofx ogg openal opencore-amr openexr opengl openmp oscar pam pam_krb5 pam_ssh pango pcmcia pcre pda pdf perl pixbuf png portaudio ppds pppd projectm python qt3support qt4 quicktime quotes rar raw rdesktop readline realmedia recode restrict-javascript rtc rtmp samba sasl schroedinger scrobbler sdl server session shout sid sift smime sndfile snmp sockets sou sound sox speex spell srt sse sse2 sse3 ssh ssl startup-notification subtitles svg sysfs syslog tcl tcpd test-programs themes theora threads tiff tk toolkit-scroll-bars truetype tta udev unicode usb userlocales utempter vcd vnc vorbis wavpack wifi wireshark wma wmf wmp wxwidgets x264 xcb xcomposite xface xft xiph xml xmp xorg xosd xpm xscreensaver xulrunner xv xvid xvmc yahoo zlib zrtp" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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 cgi cgid 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" CALLIGRA_FEATURES="braindump flow karbon kexi kpresenter krita tables words" CAMERAS="*" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en sk cs ru" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="radeon fbdev vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Dyweni 2013-01-01 17:01:05 UTC
Yes, I am having the same issues too.  

# emerge -pv baselayout openrc wpa_supplicant
...
[ebuild   R    ] sys-apps/baselayout-2.1-r1  USE="-build" 40 kB
[ebuild   R    ] sys-apps/openrc-0.11.8  USE="ncurses pam unicode -debug -newnet (-prefix) (-selinux) -static-libs" 171 kB
[ebuild   R    ] net-wireless/wpa_supplicant-0.7.3-r5  USE="readline ssl -dbus -debug -eap-sim -fasteap -gnutls -madwifi* (-ps3) -qt4 (-selinux) -wimax -wps" 0 kB


# emerge --info
Portage 2.1.11.31 (default/linux/x86/10.0, gcc-4.5.4, glibc-2.15-r3, 3.5.7-gentoo-20130101-0023 i686)
=================================================================
System uname: Linux-3.5.7-gentoo-20130101-0023-i686-Intel-R-_Atom-TM-_CPU_N450_@_1.66GHz-with-gentoo-2.1
Timestamp of tree: Tue, 01 Jan 2013 00:45:01 +0000
ld GNU ld (GNU Binutils) 2.22
app-shells/bash:          4.2_p37
dev-lang/python:          2.7.3-r2, 3.2.3
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.11.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.5.4
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.6 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo x-Dyweni x-portage
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe "
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe "
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-march=native -O2 -pipe "
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-march=native -O2 -pipe "
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/Dyweni /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="acl berkdb bzip2 cli cracklib crypt cups cxx dri fortran gdbm gpm iconv ipv6 modules mudflap ncurses nls nptl openmp pam pcre pppd readline session ssl tcpd threads unicode vim-syntax x86 zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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="authn_core authz_core socache_shmcb unixd 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 cgi cgid 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" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_US" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 2 Ian Stakenvicius gentoo-dev 2013-08-30 13:39:17 UTC
When an interface goes into the background it's status is "inactive", not "started"; Any dependent interfaces will still not start (you will have ewarn mesages like:  "ntp-client not started; waiting for net.wlan0 to start".  These are not errors and is the expected behaviour.

If ntp-client is starting *anyways* then it's because it is not depending specifically on net.wlan0 but rather 'net', and 'net' can be started even by 'net.lo' depending on your configuration (in fact, 'net' *is* started by 'net.lo' in openrc-0.8.*).

Further to this, 'associate_timeout_[iface]' is about controlling an iwconfig based wlan configuration, as that particular method cannot set itself up in the background.  wpa_supplicant doesn't need this behaviour, and although it does seem to be implemented it expressly states in the documentation that setting it could cause strange things to happen -- mainly because it doesn't affect wpa_supplicant itself but rather (i believe) any calls that wpa_supplicant makes to iwconfig, internally.

If you have services that require net.wlan0 to be up before starting, please add:

rc_need="!net net.wlan0"

...to their file in /etc/conf.d/, and see if that provides the behaviour you expect.
Comment 3 Róbert Čerňanský 2013-12-17 19:45:26 UTC
The associate_timeout_[iface] is placed under the wpa_supplicant section in /etc/conf.d/net.  The comment above it mentions that strange things could happen but it just does not work at all (which IMO is not a strange thing ;-) )  What I want to say is that by the comment one would expect that it will work *somehow* but not that it will not work at all.  If it does not work with wpa_supplicant then it should be removed from its section.

The dependency explanation makes sense but in OpenRC 0.12.4 the net.lo does not longer satisfies net dependency.  Even with this version ntp-client does not wait for net.wlan0 to become "started" and starts (and fails to) when net.wlan0 is still "inactive".  I see two possible reasons and solutions:

  - ntp-client has its dependecy defined as "after net".  It should be "need net".
Comment 4 Róbert Čerňanský 2013-12-17 19:53:28 UTC
[previous comment continues as I accidentally submitted it]

OR

  - "after net" dependency does not respect "inactive" state.  It should respect it similarly to "need net".  In other words the dependency should be satisfied after net goes to "started".

I am not sure which of the two above solutions is more appropriate (or is there any other?).  However I think that adding rc_need="!net net.wlan0" to the conf.d file is not appropriate.  ntp-client should work by default even with wpa_supplicant.
Comment 5 Ian Stakenvicius gentoo-dev 2013-12-17 19:59:36 UTC
Please attach your /etc/conf.d/net and the list of network interfaces you ahve, both within the runlevel 'ntp-client' is located in as well as via 'ifconfig' or similar tool.

I expect that the reason 'ntp-client' is starting before net.wlan0 is started (ie while it is inactive) is due to some other interface being 'started' and that being what satisfies ntp-client's 'after net'.
Comment 6 Róbert Čerňanský 2014-01-16 20:48:32 UTC
Created attachment 367968 [details]
/etc/conf.d/net
Comment 7 Róbert Čerňanský 2014-01-16 20:49:12 UTC
$ ls /etc/runlevels/default/net.*
/etc/runlevels/default/net.eth0  /etc/runlevels/default/net.wlan0


$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
    link/ether 00:17:a4:db:64:a0 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 00:1a:73:43:78:ae brd ff:ff:ff:ff:ff:ff
    inet 192.168.10.116/24 brd 192.168.10.255 scope global wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::21a:73ff:fe43:78ae/64 scope link 
       valid_lft forever preferred_lft forever


$ rc-status | egrep net\\.\|ntp-client\|Runlevel
Runlevel: default
 net.eth0                                                          [  stopped  ]
 net.wlan0                                                         [  started  ]
 ntp-client                                                        [  stopped  ]
Dynamic Runlevel: hotplugged
Dynamic Runlevel: needed
Dynamic Runlevel: manual


Hm, I do not think that it is because another interface satisfies the net dependency.  In my previous post I have mentioned that "after net" dependency should behave similarly to "need net" in respect of inactive state.  I said that because other services -- for example sshd -- behaves correctly (waits for net.wlan0 to become active).  sshd has "need net" dependency.  (At the time when I wrote this bug there may have been more services with incorrect behaviour but now it is just the ntp-client.)

Furthermore, the only active net service (after the full boot of the machine) is net.wlan0 as you can see above.