Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Installing Gentoo
  • Search

ntp-client does not start at boot.

Having problems with the Gentoo Handbook? If you're still working your way through it, or just need some info before you start your install, this is the place. All other questions go elsewhere.
Post Reply
Advanced search
17 posts • Page 1 of 1
Author
Message
LegionOfHell
Apprentice
Apprentice
Posts: 253
Joined: Sat Mar 16, 2019 2:58 am
Location: Toronto, Canada

ntp-client does not start at boot.

  • Quote

Post by LegionOfHell » Fri Sep 27, 2019 10:56 pm

What I did:

emerge --ask net-misc/ntp

rc-service ntp-client start

rc-update add ntp-client default

but when I boot i get :

* Setting clock via 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

and when i run ;

rc-service ntp-client status

it says that it is stopped...

manually starting ntp-client works...
Top
DONAHUE
Watchman
Watchman
User avatar
Posts: 7651
Joined: Sat Dec 09, 2006 4:27 pm
Location: Goose Creek SC

  • Quote

Post by DONAHUE » Sat Sep 28, 2019 12:51 am

emerge --ask net-misc/ntp
rc-update add ntpd default
reboot
Need a network connection (net), a Domain name service (dns), and a log service (logger) for ntp-client to work. The error message says dns is missing at the time ntp-client is called to start during init's default run level.
Does /etc/resolv.conf have a valid nameserver line?
Defund the FCC.
Top
LegionOfHell
Apprentice
Apprentice
Posts: 253
Joined: Sat Mar 16, 2019 2:58 am
Location: Toronto, Canada

  • Quote

Post by LegionOfHell » Sat Sep 28, 2019 2:47 am

removed ntp-client and added ntpd to default runlevel....things are working now(I get no errors) ..

How do I disable the server in ntpd and use only the client ?
Top
freke
Veteran
Veteran
Posts: 1136
Joined: Thu Jan 23, 2003 3:17 pm
Location: Somewhere in Denmark
Contact:
Contact freke
Website

  • Quote

Post by freke » Sat Sep 28, 2019 4:25 pm

ntp-client is the client - ntpd is the server - no?

is

Code: Select all

rc_use="dns"
enabled in /etc/conf.d/ntp-client?

The client is able to recover from BIG offsets - while the server bails out on starting if the offset is too big (afaik/iirc).
Top
LegionOfHell
Apprentice
Apprentice
Posts: 253
Joined: Sat Mar 16, 2019 2:58 am
Location: Toronto, Canada

  • Quote

Post by LegionOfHell » Sat Sep 28, 2019 5:31 pm

rc_use="dns" is enabled ...

ntpd is both a server and a client too...correct ?
Top
stoffepojken
n00b
n00b
User avatar
Posts: 32
Joined: Sun Jun 11, 2006 5:37 pm
Location: Stockholm, Sweden

  • Quote

Post by stoffepojken » Sat Sep 28, 2019 5:48 pm

LegionOfHell wrote:rc_use="dns" is enabled ...

ntpd is both a server and a client too...correct ?
ntpd only listens on localhost by default
Top
LegionOfHell
Apprentice
Apprentice
Posts: 253
Joined: Sat Mar 16, 2019 2:58 am
Location: Toronto, Canada

  • Quote

Post by LegionOfHell » Sat Sep 28, 2019 5:52 pm

This is how my /etc/resolv.conf looks like :

++++++++++++++
domain home
nameserver 192.168.2.1
nameserver 207.164.234.129
++++++++++++++
Top
LegionOfHell
Apprentice
Apprentice
Posts: 253
Joined: Sat Mar 16, 2019 2:58 am
Location: Toronto, Canada

  • Quote

Post by LegionOfHell » Sat Sep 28, 2019 5:55 pm

here is the line from Gentoo Wiki:

"The server is both a client, and server. If the setup can not access net early in init, use server only instead."

https://wiki.gentoo.org/wiki/Ntp#Server_2
Last edited by LegionOfHell on Sat Sep 28, 2019 6:01 pm, edited 1 time in total.
Top
stoffepojken
n00b
n00b
User avatar
Posts: 32
Joined: Sun Jun 11, 2006 5:37 pm
Location: Stockholm, Sweden

  • Quote

Post by stoffepojken » Sat Sep 28, 2019 5:56 pm

LegionOfHell wrote:
LegionOfHell wrote:rc_use="dns" is enabled ...

ntpd is both a server and a client too...correct ?
here is the line from Gentoo Wiki:

"The server is both a client, and server. If the setup can not access net early in init, use server only instead."

https://wiki.gentoo.org/wiki/Ntp#Server_2
Do you use Networkmanager?
Top
LegionOfHell
Apprentice
Apprentice
Posts: 253
Joined: Sat Mar 16, 2019 2:58 am
Location: Toronto, Canada

  • Quote

Post by LegionOfHell » Sat Sep 28, 2019 6:02 pm

dhcpcd+wpa_supplicant
Top
stoffepojken
n00b
n00b
User avatar
Posts: 32
Joined: Sun Jun 11, 2006 5:37 pm
Location: Stockholm, Sweden

  • Quote

Post by stoffepojken » Sat Sep 28, 2019 6:04 pm

Enable only localhost in /etc/ntp.conf and you have no server
Top
LegionOfHell
Apprentice
Apprentice
Posts: 253
Joined: Sat Mar 16, 2019 2:58 am
Location: Toronto, Canada

  • Quote

Post by LegionOfHell » Sat Sep 28, 2019 7:25 pm

Here is the restrict lines in my /etc/ntp.conf :

restrict default kod nomodify notrap nopeer noquery
restrict 127.0.0.1

how do I disable localhost too ? so that there are no listening ports ?
Top
stoffepojken
n00b
n00b
User avatar
Posts: 32
Joined: Sun Jun 11, 2006 5:37 pm
Location: Stockholm, Sweden

  • Quote

Post by stoffepojken » Sat Sep 28, 2019 7:35 pm

LegionOfHell wrote:Here is the restrict lines in my /etc/ntp.conf :

restrict default kod nomodify notrap nopeer noquery
restrict 127.0.0.1

how do I disable localhost too ? so that there are no listening ports ?
disable ntpd and use ntpdate as cron job may work
Top
Juippisi
Developer
Developer
User avatar
Posts: 783
Joined: Fri Sep 30, 2005 3:51 pm
Location: /home

  • Quote

Post by Juippisi » Sun Sep 29, 2019 1:15 pm

Getting npt-client to sync on boot was always behind a hassle. Ever since I switched to chrony it always just worked.
Top
LegionOfHell
Apprentice
Apprentice
Posts: 253
Joined: Sat Mar 16, 2019 2:58 am
Location: Toronto, Canada

  • Quote

Post by LegionOfHell » Sun Sep 29, 2019 1:49 pm

I guess chronyd also produces some listening ports just like ntpd ? or is it different ?
Top
madurani
n00b
n00b
Posts: 57
Joined: Wed Mar 08, 2017 8:10 am

  • Quote

Post by madurani » Fri Oct 04, 2019 11:16 am

I had same problem and solution for me was small change in /etc/init.d/ntp-client

To section start I added sleep 10:

Code: Select all

start() {
        checkconfig || return $?
        sleep 10
        ebegin "Setting clock via the NTP client '${NTPCLIENT_CMD}'"
        "${NTPCLIENT_CMD}" ${NTPCLIENT_OPTS}
        eend $? "Failed to set clock"
Top
bunder
Bodhisattva
Bodhisattva
Posts: 5956
Joined: Sat Apr 10, 2004 5:13 am

  • Quote

Post by bunder » Fri Oct 04, 2019 11:39 am

LegionOfHell wrote:How do I disable the server in ntpd and use only the client ?
if you are using /etc/conf.d/net.* (netifrc) instead of /etc/init.d/dhcpcd, you might want to edit /etc/dhcpcd.conf and enable "option ntp_servers"... then edit ntp.conf, comment out the server lines, leave the rest as-is. restart net.* and ntpd, and if all is well, you should see only one line in "ntpq -p".

cheers
Neddyseagoon wrote:The problem with leaving is that you can only do it once and it reduces your influence.
banned from #gentoo since sept 2017
Top
Post Reply

17 posts • Page 1 of 1

Return to “Installing Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic