Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 236395 - net-misc/ntpclient?: net-wireless/wpa_supplicant doesn't inform openrc about when it really connects (as NetworkManager does)
Summary: net-misc/ntpclient?: net-wireless/wpa_supplicant doesn't inform openrc about ...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-01 21:52 UTC by dejfson
Modified: 2013-12-13 19:29 UTC (History)
7 users (show)

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


Attachments
wpa_supplicant-0.6.7.ebuild (wpa_supplicant-0.6.7.ebuild,6.62 KB, text/plain)
2009-01-26 22:52 UTC, Davide Pesavento (RETIRED)
Details
ntp-client patch (ntp-client-patch,202 bytes, patch)
2013-10-29 23:10 UTC, needle
Details | Diff
verification after patch applied to ntp-client (file_236395.txt,301 bytes, text/plain)
2013-10-29 23:14 UTC, needle
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dejfson 2008-09-01 21:52:43 UTC
The ntp-client from package mentioned in subj. does not wait for correct startup of net-wireless/wpa_supplicant-0.5.7. While wpa_supplicant starts _before_ ntp-client, ntp-client is started at the moment that IP address is not acquired from the server. This results in an ntp-client which did not do the job. 
When system boots and /etc/init.d/ntp-client restart is issued, ntp-client is correctly started.

Reproducible: Always

Steps to Reproduce:
1. install wpa_supplicant, net.lo starts with 'boot'
2. install ntp package, rc-update add ntp-client default
3. try

Actual Results:  
ntp-client does not get correctly clock from the network

Expected Results:  
correct acquisition of clock

sundra mokker # rc-update -s
               acpid |      default
           alsasound | boot
             apache2 |      default
           bluetooth |      default
            bootmisc | boot
             checkfs | boot
           checkroot | boot
               clock | boot
         consolefont | boot
            cpufreqd |      default
        cpufrequtils | boot default
                dbus |      default
                 gpm |      default
                hald |      default
            hostname | boot
                 i8k |      default
             keymaps | boot
         laptop_mode |      default
               local |      default nonetwork
          localmount | boot
             modules | boot
               mysql |      default
              net.lo | boot
            netmount |      default
                 nfs |      default
          ntp-client |      default
      openafs-client |      default
           rmnologin | boot
           syslog-ng |      default
             urandom | boot
          vixie-cron |      default
                 xdm |      default


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

sundra mokker # emerge --info
Portage 2.1.4.4 (default-linux/x86/2007.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.22-gentoo-r9 i686)
=================================================================
System uname: 2.6.22-gentoo-r9 i686 Intel(R) Pentium(R) M processor 1.73GHz
Timestamp of tree: Fri, 29 Aug 2008 20:03:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.6
dev-lang/python:     2.4.4-r14, 2.5.2-r7
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
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.4_p6, 1.6.3, 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=i686 -pipe"
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/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://ftp.solnet.ch/mirror/Gentoo http://mirror.switch.ch/mirror/gentoo"
LINGUAS="en cs fr"
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"
PORTDIR_OVERLAY="/usr/portage/local/layman/synce /afs/cern.ch/user/b/belohrad/PORTAGE_OVERLAY"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 acl acpi afs alsa apache2 arts bash-completion berkdb cdr cli cracklib crypt css cups dbus debug dri dvd dvdr emacs ffmpeg flac fortran fpu gdbm gpm hal iconv isdnlog java jpeg jpeg2k kde kerberos krb4 latex ldap math midi mmx mmxext mp2 mp3 mp4 mudflap ncurses nls nptl nptlonly nsplugin ogg opengl openmp pam pcre perl php png pppd python qt3 qt4 readline reflection session spell spl sse sse2 ssl tcl tcpd tiff truetype unicode v4l2 win32codecs x86 xml xorg xv 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="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 keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en cs fr" USERLAND="GNU" VIDEO_CARDS="fglrx radeon"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 SpanKY gentoo-dev 2008-09-06 05:00:16 UTC
ntp-client declares "need net" ... that means ntp-client has done everything it is supposed to.  if the network isnt available, it isnt ntp's fault.
Comment 2 dejfson 2008-09-15 20:44:12 UTC
Hmm, then this bug should be assigned to wpa_supplicant guys I guess?



(In reply to comment #1)
> ntp-client declares "need net" ... that means ntp-client has done everything it
> is supposed to.  if the network isnt available, it isnt ntp's fault.
> 

Comment 3 dejfson 2008-09-15 20:46:13 UTC
Could someone taking care about wpa_supplicant look whether 'net' flags used in 'need net' of ebuilds is set to valid only when wpa_supplicant acquires an IP address from DHCP and network is fully setup? (so ping to ... should work)

Comment 4 Roy Marples 2008-10-26 20:22:48 UTC
(In reply to comment #3)
> Could someone taking care about wpa_supplicant look whether 'net' flags used in
> 'need net' of ebuilds is set to valid only when wpa_supplicant acquires an IP
> address from DHCP and network is fully setup? (so ping to ... should work)

Yes, no, depending on /etc/rc.conf strict dependency setting and if said net services are hotpluggd or in the runlevel.
However, if setup correct, yes services that need net will only start once wpa_supplicant has associated AND the rest of the configuration has completed.

However, there is an issue with ath5k cards where this doesn't work at boot, but does afterwards. See bug #240383
Comment 5 Davide Pesavento (RETIRED) gentoo-dev 2009-01-26 22:52:47 UTC
Created attachment 179819 [details]
wpa_supplicant-0.6.7.ebuild

Updated ebuild using EAPI-2.

*) Fix wrong dependencies when USE="gnutls ssl"
*) USE="qt3support" for x11-libs/qt:4 is no longer necessary
*) Enable EAP_AKA_PRIME (untested)
*) Disable DRIVER_PRISM54 (upstream says it's "not yet supported, i.e., this will not work as-is and is for developers only")
*) WPS doesn't compile, so I didn't enable it
*) Enable DELAYED_MIC_ERROR_REPORT to mitigate some attacks against TKIP
*) Use eqmake{3,4} from qt{3,4}.eclass instead of directly invoking qmake
*) Added some die() calls in src_install()
*) Fix bug #207791
Comment 6 Davide Pesavento (RETIRED) gentoo-dev 2009-01-26 22:54:47 UTC
Oops! Sorry, wrong bug!
Comment 7 Gokdeniz Karadag 2011-04-17 19:40:08 UTC
You can try stating a value in "associate_timeout_eth0" variable , so that the net script waits until the wpa_supplicant associates and authenticates. 


From /usr/share/doc/openrc-0.8.2/net.example :

# By default we don't wait for wpa_supplicant to associate and authenticate.
# If you need to change this behaviour then you don't know how our scripts work
# and setting this value could cause strange things to happen.
# If you would like to, so can specify how long in seconds.
#associate_timeout_eth0=60
# A value of 0 means wait forever.
Comment 8 Pavel Šimerda 2012-11-23 09:35:16 UTC
Just a short comment. Dependencies on network connectivity can't be unfortunately
fixed in OpenRC. There are numerous ways to do network configuration but even if you take NetworkManager as an example, network connectivity can be acquired at *any* time, e.g. when user toggles the rfkill switch.

For more information, see:

https://fedoraproject.org/wiki/Networking/Dependencies

(any comments appreciated)
Comment 9 needle 2013-10-29 00:34:17 UTC
I don't know if the problem is related to wpa_supplicant, can't reproduce such behaviour with nptd. It is not exactly ntp-client, but serves the same purpose.

Using now wpa_supplicant-2.0-r2, however this ouput below applies as well to 0.7 version of wpa_supplicant.

Deamons depending on net are put in background on this machine.
----

* Bringing up interface wlan0
 *   Starting wpa_supplicant on wlan0 ...
[...]
 * WARNING: net.wlan0 has started, but is inactive
 * WARNING: ntpd is scheduled to start when net.wlan0 has started
 * WARNING: sshd is scheduled to start when net.wlan0 has started

---
Using wpa_supplicant only here, no wicd or other network manager. So bug report might apply only to the "network manager" the initial user was using.
Comment 10 needle 2013-10-29 22:39:02 UTC
It is correct, I could reproduce this error message with wpa-supplicant-2.0-rc2
ntp-client calls ntpdate
nptdate shows a name resolution error.
The ntpdate command/daemon is not put in the background like f.e. nptd does
Sorry for the noise.
------------

 * Bringing up interface wlan0
 *   Starting wpa_supplicant on wlan0 ...Successfully initialized wpa_supplicant   [ ok ] 
 *   Starting wpa_cli on wlan0 ...                               [ ok ] 
 *   Backgrounding ...
 * WARNING: net.wlan0 has started, but is inactive
 * Setting clock via the NTP client 'ntpdate' ...
Exiting, name server cannot be used: Temporary failure in name resolution (-3) 
* Failed to set clock                                                               [ !! ] 
* ERROR: ntp-client failed to start
* WARNING: sshd is scheduled to start when net.wlan0 has started

-----
Comment 11 needle 2013-10-29 22:53:20 UTC
I have been able to background the ntpdate process:
It now does not timeout and sets the time when wpa_supplicant (dhcpd) is ready:

-----
2013-10-29T23:44:29.454240+01:00 sigma dhcpcd[2212]: forked to background, child pid 2269
2013-10-29T23:44:29.525035+01:00 sigma sshd[2333]: Server listening on 0.0.0.0 port 22.
2013-10-29T23:44:37.171242+01:00 sigma ntpdate[2324]: step time server 131.188.3.221 offset -1.711800 sec
---

I will test a bit and submit a patch if test is successful.
Comment 12 needle 2013-10-29 23:10:07 UTC
Created attachment 362268 [details, diff]
ntp-client patch

Attached a patch, this works on my machine so ntp-client is run in the background, and sets time after IP is available.
Comment 13 needle 2013-10-29 23:14:46 UTC
Created attachment 362272 [details]
verification after patch applied to ntp-client
Comment 14 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2013-12-13 19:15:29 UTC
Reassigning to maintainer for ntp-client (which currently is no-one).

This clearly is a bug with ntp-client, and not wpa_supplicant :)
Comment 15 Pacho Ramos gentoo-dev 2013-12-13 19:29:07 UTC
I don't understand this: what exact package are you using for ntp? also post "equery b /etc/init.d/ntp-client" output