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

Bug 480424

Summary: ntp-client.service starts earlier than network connection is established
Product: Gentoo Linux Reporter: Alexei Ababilov <ilovegnulinux>
Component: [OLD] Core systemAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED WONTFIX    
Severity: normal CC: ilovegnulinux
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Alexei Ababilov 2013-08-09 19:15:47 UTC
ntp-client.service starts /usr/sbin/ntpdate immediately, before network connection is established:

$ sudo systemctl status ntp-client.service 
ntp-client.service - Set time via NTP
   Loaded: loaded (/usr/lib64/systemd/system/ntp-client.service; enabled)
   Active: failed (Result: exit-code) since Fri 2013-08-09 21:26:12 EEST; 11min ago
  Process: 3294 ExecStart=/usr/sbin/ntpdate $NTPCLIENT_OPTS (code=exited, status=1/FAILURE)

Aug 09 21:26:19 toshiba.alessio.org ntpdate[3294]: Error resolving 0.gentoo.pool.ntp.org: Name or service not known (-2)
Aug 09 21:26:19 toshiba.alessio.org ntpdate[3294]: Error resolving 1.gentoo.pool.ntp.org: Name or service not known (-2)
Aug 09 21:26:19 toshiba.alessio.org ntpdate[3294]: Error resolving 2.gentoo.pool.ntp.org: Name or service not known (-2)
Aug 09 21:26:19 toshiba.alessio.org ntpdate[3294]: Error resolving 3.gentoo.pool.ntp.org: Name or service not known (-2)
Comment 1 Alexei Ababilov 2013-08-09 19:22:50 UTC
This is a proposed solution that uses Fedora's ntpdate-wrapper that runs ntpdate several times with a growing delay between attempts:

https://github.com/aababilov/portage/tree/master/net-misc/ntp
Comment 2 Alexei Ababilov 2013-08-09 20:19:23 UTC
Another solution is just to

sudo systemctl enable NetworkManager-wait-online.service