Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] ntp-client does not start at boot time
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Verdazil
n00b
n00b


Joined: 14 Feb 2019
Posts: 47
Location: One small country ...

PostPosted: Sat Mar 16, 2019 7:33 pm    Post subject: [solved] ntp-client does not start at boot time Reply with quote

After system boot I can successfully run manually:
Code:
# rc-service ntp-client start
 * Setting clock via the NTP client 'ntpdate' ...    [ ok ]

But if I add the service to runlevel default, an error occurs at boot time and servive does not start.
How to fix this problem?
_________________
GA-Z170X-UD3 / i7-6700K / DDR4 32GB / Radeon RX 570 / TL-WDN4800 / Samsung SSD 850 EVO 250 Gb + WD Green WDC 2 Tb / BenQ BL2711U + LG TV 42LF650V


Last edited by Verdazil on Sun Mar 17, 2019 5:10 am; edited 1 time in total
Back to top
View user's profile Send private message
freke
l33t
l33t


Joined: 23 Jan 2003
Posts: 977
Location: Somewhere in Denmark

PostPosted: Sat Mar 16, 2019 7:58 pm    Post subject: Reply with quote

Is dns up/working when ntp-client is run during startup?

You might need:
Code:
rc_use="dns"
in /etc/conf.d/ntp-client
Back to top
View user's profile Send private message
Verdazil
n00b
n00b


Joined: 14 Feb 2019
Posts: 47
Location: One small country ...

PostPosted: Sat Mar 16, 2019 8:17 pm    Post subject: Reply with quote

freke wrote:
Is dns up/working when ntp-client is run during startup? You might need:
Code:
rc_use="dns"
in /etc/conf.d/ntp-client

Yes, this setting initially is set to
Code:
rc_use="dns"

_________________
GA-Z170X-UD3 / i7-6700K / DDR4 32GB / Radeon RX 570 / TL-WDN4800 / Samsung SSD 850 EVO 250 Gb + WD Green WDC 2 Tb / BenQ BL2711U + LG TV 42LF650V
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54244
Location: 56N 3W

PostPosted: Sat Mar 16, 2019 8:31 pm    Post subject: Reply with quote

Verdazil,

Please post the exact error message.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Verdazil
n00b
n00b


Joined: 14 Feb 2019
Posts: 47
Location: One small country ...

PostPosted: Sat Mar 16, 2019 8:43 pm    Post subject: Reply with quote

Log file: /var/log/syslog
Code:
16.03.2019 22:19   ivybridge-pc   /etc/init.d/ntp-client[4359]   ERROR: ntp-client failed to start

_________________
GA-Z170X-UD3 / i7-6700K / DDR4 32GB / Radeon RX 570 / TL-WDN4800 / Samsung SSD 850 EVO 250 Gb + WD Green WDC 2 Tb / BenQ BL2711U + LG TV 42LF650V
Back to top
View user's profile Send private message
freke
l33t
l33t


Joined: 23 Jan 2003
Posts: 977
Location: Somewhere in Denmark

PostPosted: Sat Mar 16, 2019 8:46 pm    Post subject: Reply with quote

You can try looking in /var/log/rc.log too (might need to enable rc-logging in /etc/rc.conf) and/or add -v to NTPOPTS in /etc/conf.d/ntp-client (dunno what -v really adds to logging)
Back to top
View user's profile Send private message
Verdazil
n00b
n00b


Joined: 14 Feb 2019
Posts: 47
Location: One small country ...

PostPosted: Sat Mar 16, 2019 8:58 pm    Post subject: Reply with quote

Log file: /var/log/syslog
Code:
16.03.2019 22:49   ivybridge-pc   ntpdate[4381]   name server cannot be used: Temporary failure in name resolution (-3)
16.03.2019 22:49   ivybridge-pc   /etc/init.d/ntp-client[4361]   ERROR: ntp-client failed to start


Log file: /var/log/rc.log:
Code:
16.03.2019 22:53          * Setting clock via the NTP client 'ntpdate' ...
16.03.2019 22:53          * ERROR: ntp-client failed to start

_________________
GA-Z170X-UD3 / i7-6700K / DDR4 32GB / Radeon RX 570 / TL-WDN4800 / Samsung SSD 850 EVO 250 Gb + WD Green WDC 2 Tb / BenQ BL2711U + LG TV 42LF650V
Back to top
View user's profile Send private message
freke
l33t
l33t


Joined: 23 Jan 2003
Posts: 977
Location: Somewhere in Denmark

PostPosted: Sat Mar 16, 2019 9:09 pm    Post subject: Reply with quote

What happens if you set a numeric ip-address for a ntp-server instead of server-names in /etc/conf.d/ntp-client ?

Just to rule out dns-problems at booting.
Back to top
View user's profile Send private message
Verdazil
n00b
n00b


Joined: 14 Feb 2019
Posts: 47
Location: One small country ...

PostPosted: Sat Mar 16, 2019 9:25 pm    Post subject: Reply with quote

I set in /etc/conf.d/ntp-client
Code:
NTPCLIENT_OPTS="-s -v -b -u \
   0.172.26.136.19 1.172.26.136.19 \
   2.172.26.136.19 3.172.26.136.19"

Nothing changed.
_________________
GA-Z170X-UD3 / i7-6700K / DDR4 32GB / Radeon RX 570 / TL-WDN4800 / Samsung SSD 850 EVO 250 Gb + WD Green WDC 2 Tb / BenQ BL2711U + LG TV 42LF650V
Back to top
View user's profile Send private message
freke
l33t
l33t


Joined: 23 Jan 2003
Posts: 977
Location: Somewhere in Denmark

PostPosted: Sat Mar 16, 2019 9:31 pm    Post subject: Reply with quote

It should just be:
Code:
NTPCLIENT_OPTS="-s -v -b -u \
   172.26.136.19"
Given that 172.26.136.19 is a ntp-server on your lan?

0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org resolves to 4 different servers.
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3922
Location: Hamburg

PostPosted: Sat Mar 16, 2019 9:46 pm    Post subject: Re: ntp-client does not start at boot time Reply with quote

Verdazil wrote:
After system boot I can successfully run manually:
Code:
# rc-service ntp-client start
 * Setting clock via the NTP client 'ntpdate' ...    [ ok ]

But if I add the service to runlevel default, an error occurs at boot time and servive does not start.
How to fix this problem?
Code:
rc-update add net-online
might help you
Back to top
View user's profile Send private message
The Main Man
Veteran
Veteran


Joined: 27 Nov 2014
Posts: 1166
Location: /run/user/1000

PostPosted: Sat Mar 16, 2019 11:10 pm    Post subject: Reply with quote

I use chrony, you can try it, it works fine.
Nothing special needs to be done :
Code:
# emerge chrony
# rc-update add chronyd default


and that's it.
https://wiki.gentoo.org/wiki/Chrony
Back to top
View user's profile Send private message
Verdazil
n00b
n00b


Joined: 14 Feb 2019
Posts: 47
Location: One small country ...

PostPosted: Sun Mar 17, 2019 5:09 am    Post subject: Reply with quote

toralf wrote:
Code:
rc-update add net-online
might help you

Nothing changed.

kajzer wrote:
I use chrony, you can try it, it works fine.
Nothing special needs to be done :
Code:
# emerge chrony
# rc-update add chronyd default

Yes, this option works, all thanks.
_________________
GA-Z170X-UD3 / i7-6700K / DDR4 32GB / Radeon RX 570 / TL-WDN4800 / Samsung SSD 850 EVO 250 Gb + WD Green WDC 2 Tb / BenQ BL2711U + LG TV 42LF650V
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum