Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 164278 - net-misc/ntp-4.2.4 ntp-client starts before networkmanager brings up eth0
Summary: net-misc/ntp-4.2.4 ntp-client starts before networkmanager brings up eth0
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Project Gentopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-28 18:37 UTC by Jose daLuz
Modified: 2008-02-02 07:40 UTC (History)
7 users (show)

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


Attachments
/etc/init.d/NetworkManagerDispatcher (NetworkManagerDispatcher,1.14 KB, text/plain)
2007-06-19 07:33 UTC, Nathan Caldwell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jose daLuz 2007-01-28 18:37:38 UTC
Running net-misc/networkmanager-0.6.4_pre20061028-r1 and ntp-4.2.4, ntp-client fails to start because it doesn't wait for networkmanager to finish bringing up eth0:

Jan 28 12:47:37 joehome NetworkManager: <info>  Will activate connection 'eth0'.
Jan 28 12:47:37 joehome NetworkManager: <info>  Device eth0 activation scheduled...
Jan 28 12:47:37 joehome NetworkManager: <info>  Activation (eth0) started...
Jan 28 12:47:37 joehome NetworkManager: <info>  Activation (eth0) Stage 1 of 5 (Device Prepare) scheduled...
Jan 28 12:47:37 joehome NetworkManager: <info>  Activation (eth0) Stage 1 of 5 (Device Prepare) started...
Jan 28 12:47:37 joehome NetworkManager: <info>  Activation (eth0) Stage 2 of 5 (Device Configure) scheduled...
Jan 28 12:47:37 joehome NetworkManager: <info>  Activation (eth0) Stage 1 of 5 (Device Prepare) complete.
Jan 28 12:47:37 joehome NetworkManager: <info>  Activation (eth0) Stage 2 of 5 (Device Configure) starting...
Jan 28 12:47:37 joehome NetworkManager: <info>  Activation (eth0) Stage 2 of 5 (Device Configure) successful.
Jan 28 12:47:37 joehome NetworkManager: <info>  Activation (eth0) Stage 3 of 5 (IP Configure Start) scheduled.
Jan 28 12:47:37 joehome NetworkManager: <info>  Activation (eth0) Stage 2 of 5 (Device Configure) complete.
Jan 28 12:47:37 joehome NetworkManager: <info>  Activation (eth0) Stage 3 of 5 (IP Configure Start) started...
Jan 28 12:47:37 joehome /etc/init.d/ntp-client: Failed to set clock 
Jan 28 12:47:37 joehome /etc/init.d/ntp-client: ERROR:  ntp-client failed to start 
Jan 28 12:47:37 joehome ntpd[4217]: ntpd 4.2.4@1.1437-o Sun Dec 31 22:30:52 UTC 2006 (1)
Jan 28 12:47:37 joehome ntpd[4218]: precision = 1.000 usec
Jan 28 12:47:37 joehome ntpd[4218]: ntp_io: estimated max descriptors: 1024, initial socket boundary: 16
Jan 28 12:47:38 joehome ntpd[4218]: Listening on interface #0 wildcard, 0.0.0.0#123 Disabled
Jan 28 12:47:38 joehome ntpd[4218]: Listening on interface #1 lo, 127.0.0.1#123 Enabled
Jan 28 12:47:38 joehome ntpd[4218]: Listening on interface #2 vmnet1, 192.168.204.1#123 Enabled
Jan 28 12:47:38 joehome ntpd[4218]: Listening on interface #3 vmnet8, 192.168.129.1#123 Enabled
Jan 28 12:47:38 joehome ntpd[4218]: kernel time sync status 0040
Jan 28 12:47:38 joehome ntpd[4218]: Cannot find existing interface for address 68.87.71.226
Jan 28 12:47:38 joehome ntpd[4218]: configuration of 68.87.71.226 failed
Jan 28 12:47:38 joehome ntpd[4218]: Cannot find existing interface for address 68.87.73.242
Jan 28 12:47:38 joehome ntpd[4218]: configuration of 68.87.73.242 failed
Jan 28 12:47:38 joehome ntpd[4218]: frequency initialized -75.671 PPM from /var/lib/ntp/ntp.drift
Jan 28 12:47:38 joehome NetworkManager: <info>  Activation (eth0) Beginning DHCP transaction.
Jan 28 12:47:38 joehome dhcdbd: dhc 0x5234c0 0 INACTIVE -> UP_REQUEST
Jan 28 12:47:38 joehome dhcdbd: dhc 0x5234c0 0 UP_REQUEST -> UP_START
Jan 28 12:47:38 joehome dhcdbd: dhc 0x5234c0 4273 UP_START -> UP
Jan 28 12:47:38 joehome NetworkManager: <info>  Activation (eth0) Stage 3 of 5 (IP Configure Start) complete.
Jan 28 12:47:38 joehome NetworkManager: <info>  DHCP daemon state is now 12 (successfully started) for interface eth0
Jan 28 12:47:39 joehome postfix/postfix-script: starting the Postfix mail system
Jan 28 12:47:39 joehome postfix/master[4317]: daemon started -- version 2.3.6, configuration /etc/postfix
--- smartd startup snipped ---
Jan 28 12:47:39 joehome NetworkManager: <info>  DHCP daemon state is now 1 (starting) for interface eth0
Jan 28 12:47:39 joehome dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
Jan 28 12:47:39 joehome dhclient: DHCPOFFER from 192.168.0.129
Jan 28 12:47:39 joehome dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 67
Jan 28 12:47:39 joehome dhclient: DHCPACK from 192.168.0.129
Jan 28 17:47:39 joehome avahi-daemon[3610]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.0.135.
Jan 28 17:47:39 joehome avahi-daemon[3610]: New relevant interface eth0.IPv4 for mDNS.
Jan 28 17:47:39 joehome avahi-daemon[3610]: Registering new address record for 192.168.0.135 on eth0.IPv4.
Jan 28 17:47:39 joehome avahi-daemon[3610]: Withdrawing address record for 192.168.0.135 on eth0.
Jan 28 17:47:39 joehome avahi-daemon[3610]: Leaving mDNS multicast group on interface eth0.IPv4 with address 192.168.0.135.
Jan 28 17:47:39 joehome avahi-daemon[3610]: Interface eth0.IPv4 no longer relevant for mDNS.
Jan 28 17:47:39 joehome avahi-daemon[3610]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.0.135.
Jan 28 17:47:39 joehome avahi-daemon[3610]: New relevant interface eth0.IPv4 for mDNS.
Jan 28 17:47:39 joehome avahi-daemon[3610]: Registering new address record for 192.168.0.135 on eth0.IPv4.
Jan 28 12:47:39 joehome NetworkManager: <info>  DHCP daemon state is now 2 (bound) for interface eth0
Jan 28 12:47:39 joehome NetworkManager: <info>  Activation (eth0) Stage 4 of 5 (IP Configure Get) scheduled...
Jan 28 12:47:39 joehome NetworkManager: <info>  Activation (eth0) Stage 4 of 5 (IP Configure Get) started...
Jan 28 12:47:39 joehome dhclient: bound to 192.168.0.135 -- renewal in 40465 seconds.
Jan 28 12:47:39 joehome dhcdbd: message_handler: message handler not found under /com/redhat/dhcp/eth0 for sub-path eth0.dbus.get.host_name
Jan 28 12:47:39 joehome dhcdbd: message_handler: message handler not found under /com/redhat/dhcp/eth0 for sub-path eth0.dbus.get.nis_domain
Jan 28 12:47:39 joehome dhcdbd: message_handler: message handler not found under /com/redhat/dhcp/eth0 for sub-path eth0.dbus.get.nis_servers
Jan 28 12:47:39 joehome NetworkManager: <info>  Retrieved the following IP4 configuration from the DHCP daemon:
Jan 28 12:47:39 joehome NetworkManager: <info>    address 192.168.0.135
Jan 28 12:47:39 joehome NetworkManager: <info>    netmask 255.255.255.128
Jan 28 12:47:39 joehome NetworkManager: <info>    broadcast 192.168.0.255
Jan 28 12:47:39 joehome NetworkManager: <info>    gateway 192.168.0.129
Jan 28 12:47:39 joehome NetworkManager: <info>    nameserver 192.168.0.1
Jan 28 12:47:39 joehome NetworkManager: <info>    domain name 'hsd1.ma.comcast.net.'
Jan 28 12:47:39 joehome NetworkManager: <info>  Activation (eth0) Stage 5 of 5 (IP Configure Commit) scheduled...
Jan 28 12:47:39 joehome NetworkManager: <info>  Activation (eth0) Stage 4 of 5 (IP Configure Get) complete.
Jan 28 12:47:39 joehome NetworkManager: <info>  Activation (eth0) Stage 5 of 5 (IP Configure Commit) started...
Jan 28 17:47:39 joehome avahi-daemon[3610]: Withdrawing address record for 192.168.0.135 on eth0.
Jan 28 17:47:39 joehome avahi-daemon[3610]: Leaving mDNS multicast group on interface eth0.IPv4 with address 192.168.0.135.
Jan 28 17:47:39 joehome avahi-daemon[3610]: Interface eth0.IPv4 no longer relevant for mDNS.
Jan 28 17:47:39 joehome avahi-daemon[3610]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.0.135.
Jan 28 17:47:39 joehome avahi-daemon[3610]: New relevant interface eth0.IPv4 for mDNS.
Jan 28 17:47:39 joehome avahi-daemon[3610]: Registering new address record for 192.168.0.135 on eth0.IPv4.
Jan 28 12:47:40 joehome sshd[4448]: Server listening on 0.0.0.0 port 22001.
Jan 28 12:47:40 joehome cron[4507]: (CRON) STARTUP (V5.0)
Jan 28 12:47:40 joehome NetworkManager: <WARN>  nm_system_set_hostname(): nm_system_set_hostname(): gethostbyaddr failed, h_errno = 1
Jan 28 12:47:40 joehome NetworkManager: <info>  Activation (eth0) successful, device activated.
Jan 28 12:47:40 joehome NetworkManager: <info>  Activation (eth0) Finish handler scheduled.
Jan 28 12:47:40 joehome NetworkManager: <info>  Activation (eth0) Stage 5 of 5 (IP Configure Commit) complete.

Could this be related to bug 154670?
Comment 1 Jose daLuz 2007-01-28 18:38:34 UTC
Bugzilla wouldn't let me fit this in the initial post:

Portage 2.1.2-r4 (default-linux/amd64/2006.1/desktop, gcc-4.1.1, glibc-2.5-r0, 2.6.19-gentoo-r4 x86_64)
=================================================================
System uname: 2.6.19-gentoo-r4 x86_64 AMD Athlon(tm) 64 Processor 3000+
Gentoo Base System version 1.13.0_alpha12
Timestamp of tree: Sun, 28 Jan 2007 14:20:01 +0000
ccache version 2.4 [enabled]
dev-java/java-config: 1.3.7, 2.0.31-r3
dev-lang/python:     2.4.4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r6
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.19.2-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe -ggdb"
CHOST="x86_64-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"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-march=k8 -O2 -pipe -ggdb -ffriend-injection"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS=""
FEATURES="autoconfig ccache distlocks fixpackages parallel-fetch sandbox sfperms splitdebug strict"
GENTOO_MIRRORS="http://distro.ibiblio.org/pub/linux/distributions/gentoo/ http://gentoo.osuosl.org/ "
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LINGUAS="en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_EXTRA_OPTS="--timeout=120"
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/portage/local/layman/sunrise /usr/portage/local/layman/wrobel /usr/portage/local/layman/gnome-experimental /usr/portage/local/layman/break-my-gentoo-main /usr/local/overlays/myoverlay /usr/local/overlays/bmg-main"
SYNC="rsync://rsync.ca.gentoo.org/gentoo-portage"
USE="X a52 aac alsa amd64 amr bash-completion berkdb bitmap-fonts bzip2 cairo cdda cdr cli cracklib crypt css cups dbus debug dlloader dri dts dvd dvdr eds emboss encode esd fam ffmpeg firefox flac fortran gdbm gif glitz gnome gpm gstreamer gtk gtk2 hal iconv ipv6 isdnlog java jpeg kde kdehiddenvisibility ldap libg++ libnotify mad mikmod mono mp3 mpeg ncurses nls nptl nptlonly ogg opengl pam pcre perl pic png ppds pppd python qt3 qt4 quicktime readline reflection ruby samba sdl session spell spl sqlite ssl tcpd theora tiff truetype truetype-fonts type1-fonts udev unicode usb userlocales vcd vorbis x264 xcb xml xorg xv xvid zlib" ALSA_CARDS="emu10k1" 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" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" USERLAND="GNU" VIDEO_CARDS="vesa nvidia"
Unset:  CTARGET, INSTALL_MASK, LDFLAGS
Comment 2 Brian Dolbec (RETIRED) gentoo-dev 2007-02-23 15:24:36 UTC
I am now using net-misc/ntp-4.2.4_p3 and for 6 months or more ntp-client it has not been working.  I believe that have even done an upgrade at some point with it still not working.  A forum and google search turned up nothing when it first did not work as well as now.

Enough of the babble.

big_squirt backends # /etc/init.d/ntp-client start
 * Caching service dependencies ...
 *  Can't find service 'after' needed by 'ntp-client';  continuing...                                                             [ ok ]
after
 * ERROR:  Some services needed are missing.  Run
 *         './ntp-client broken' for a list of those
 *         services.  ntp-client was not started.
big_squirt backends # /etc/init.d/ntp-client broken
after
big_squirt backends # 

I re-emerged the package to pick up any missing files, etc..

I ran dispatch-conf:

>> (1 of 2) -- /etc/conf.d/ntp-client
>> q quit, h help, n next, e edit-new, z zap-new, u use-new
--- /etc/init.d/ntp-client      2007-02-22 23:59:50.000000000 -0800
+++ /etc/init.d/._mrg0000_ntp-client    2007-02-23 00:01:37.000000000 -0800
@@ -1,7 +1,7 @@
 #!/sbin/runscript
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2007 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/ntp/files/ntp-client.rc,v 1.8 2005/05/14 19:12:04 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/ntp/files/ntp-client.rc,v 1.9 2007/01/09 17:51:14 vapier Exp $
 
 depend() {
        before cron portmap
@@ -10,12 +10,12 @@
 }
 
 checkconfig() {
-       if [ ! -x "`which ${NTPCLIENT_CMD} 2>/dev/null`" ] ; then
+       if ! type -p ${NTPCLIENT_CMD} > /dev/null ; then
                eerror "Please edit /etc/conf.d/ntp-client"
                eerror "Unable to locate the client command ${NTPCLIENT_CMD}!"
                return 1
        fi
-       if [ -z "${NTPCLIENT_OPTS}" ] ; then
+       if [[ -z ${NTPCLIENT_OPTS} ]] ; then
                eerror "Please edit /etc/conf.d/ntp-client"
                eerror "I need to know what server/options to use!"
                return 1
@@ -28,8 +28,5 @@
 
        ebegin "Setting clock via the NTP client '${NTPCLIENT_CMD}'"
        ${NTPCLIENT_CMD} ${NTPCLIENT_OPTS} >/dev/null &
-       local pid=$!
-       (sleep ${NTPCLIENT_TIMEOUT:-30}; kill -9 ${pid} >&/dev/null) &
-       wait ${pid}
        eend $? "Failed to set clock"
 }

>> (2 of 2) -- /etc/init.d/ntp-client
>> q quit, h help, n next, e edit-new, z zap-new, u use-new
   m merge, t toggle-merge, l look-merge: 
big_squirt backends # 


It still was not working.

Paul Bradbury on the forums solved it for me.
http://forums.gentoo.org/viewtopic-t-542225.html
There is a mistake in the /etc/init.d/ntp-client script:

   need net after net.eth0

should be changed to:

   need net
   after net.eth0

That has fixed the problem for me.
Comment 3 Jose daLuz 2007-03-02 03:59:02 UTC
@Brian, I think you have a different problem than the one I filed this bug about. Yours seems to have been fixed in 4.2.4-r1. 

My problem still exists, even with 4.2.4-r1.
Comment 4 Jose daLuz 2007-05-10 01:27:15 UTC
This seems to be fixed in 4.2.4_p0 (or perhaps by baselayout 2.0.0_alpha2-r1 as I updated both at the same time -- I was at 1.13.0_alpha12 before this).
Comment 5 Nathan Caldwell 2007-06-19 07:28:53 UTC
This is because of the way NetworkManager works. You need to setup NetworkManagerDispatcher. This isn't included/setup by default like it probably should be.
I'll attach the init script, although it is really steev's work. You need to create /etc/NetworkManager/dispatcher.d on you own, and populate it. Read the manpage for NetworkManagerDispatcher for more.
Comment 6 Nathan Caldwell 2007-06-19 07:33:32 UTC
Created attachment 122503 [details]
/etc/init.d/NetworkManagerDispatcher
Comment 7 Roy Marples (RETIRED) gentoo-dev 2007-07-11 13:16:49 UTC
Not sure how the net dependency should be handled by NetworkManager so assigning to Gentopia.
Comment 8 Steev Klimaszewski (RETIRED) gentoo-dev 2007-08-10 21:03:07 UTC
Yes, I need to add the NMDispatcher init script, I thought it was in there, but unfortunately, it was in Gentopia, which got deleted by Genstef during one cleaning session and I didn't realize it.  Apps requiring net will need to do something in /etc/NetworkManager/dispatch.d - or rather, ones using specific IPs - NetworkManager however does *not* provide net when used with wireless since it sometimes requires user intervention (when connecting to encrypted networks) and requires a graphical display (for one of the applets) and since we can't say, xxx is the network card, provide net in the initscript, unfortunately won't work.  Hopefully I will get to this tonight or sometime this weekend. Sorry for the delay!
Comment 9 Stefan Briesenick (RETIRED) gentoo-dev 2008-01-31 00:34:00 UTC
that Dispatcher-Init-Script is still not included... :-/
Comment 10 Steev Klimaszewski (RETIRED) gentoo-dev 2008-02-02 07:40:40 UTC
It is now - Sorry, there were 2 bugs open about this, just noticed this one.