Page 1 of 1

[Solved] NTPD will not start at boot

Posted: 2016/07/18 20:22:23
by thepo6
Hey All, i'm new to this forum and thought i'd look around to see if someone has any ideas about an issue i'm having.
i have a Centos7 server (lastest patches as of today) running on a hardware server.

i've installed NTP and enabled it to start at boot by running:
systemctl enable ntpd

the service will not turn on during boot, but if i manually start it via "systemctl start ntpd" it works fine.

i've heard of ntpd and ntpdate conflicting, so i made sure that ntpdate is not running "systemctl stop ntpdate" "systemctl disable ntpdate"

after a reboot, i see these logs:

Code: Select all

journalctl -b | grep ntpd
Jul 18 16:36:46 #hostname# systemd[1]: Looking at job ntpd.service/stop conflicted_by=yes
Jul 18 16:36:46 #hostname# systemd[1]: Looking at job ntpd.service/start conflicted_by=no
Jul 18 16:36:46 #hostname# systemd[1]: Fixing conflicting jobs ntpd.service/stop,ntpd.service/start by deleting job ntpd.service/start

Code: Select all

systemctl status ntpd
● ntpd.service - Network Time Service
Loaded: loaded (/etc/systemd/system/ntpd.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/ntpd.service.d
└─override.conf
Active: inactive (dead)

Code: Select all

cat /var/log/messages | grep ntpd
Jul 18 13:19:45 #hostname# ntpd[11764]: ntpd 4.2.6p5@1.2349-o Tue May 31 10:28:54 UTC 2016 (1)
Jul 18 13:19:45 #hostname# ntpd[11765]: proto: precision = 0.095 usec
Jul 18 13:19:45 #hostname# ntpd[11765]: 0.0.0.0 c01d 0d kern kernel time sync enabled
Jul 18 13:19:45 #hostname# ntpd[11765]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
Jul 18 13:19:45 #hostname# ntpd[11765]: Listen and drop on 1 v6wildcard :: UDP 123
Jul 18 13:19:45 #hostname# ntpd[11765]: Listen normally on 2 lo 127.0.0.1 UDP 123
Jul 18 13:19:45 #hostname# ntpd[11765]: Listen normally on 6 team0 192.168.0.10 UDP 123
Jul 18 13:19:45 #hostname# ntpd[11765]: Listening on routing socket on fd #23 for interface updates
Jul 18 13:19:45 #hostname# ntpd[11765]: 0.0.0.0 c016 06 restart
Jul 18 13:19:45 #hostname# ntpd[11765]: 0.0.0.0 c012 02 freq_set kernel 10.213 PPM
Jul 18 13:19:46 #hostname# ntpd[11765]: 0.0.0.0 c615 05 clock_sync

i'm open to ideas or troubleshooting tips

thanks for taking the time.

Re: NTPD will not start at boot

Posted: 2016/07/19 06:46:28
by larwood
CentOS7 defaults to chronyd for NTP services. This service is probably configured to start at boot and using port 123. When ntpd attempts to start if fails because port 123 is already in use.

You can check this with

Code: Select all

# netstat -tulpn | grep 123
To use ntpd you will need to stop and disable the chronyd service, then start the nptd service.

Re: NTPD will not start at boot

Posted: 2016/07/19 11:41:45
by thepo6
I owe you a beer my friend, disabling chronyd did the trick. the NTPD service now comes up at boot.

Thank you

Code: Select all

systemctl disable chronyd
Loaded: loaded (/etc/systemd/system/ntpd.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/ntpd.service.d
└─override.conf
Active: active (running) since Tue 2016-07-19 08:33:24 ADT; 3min 46s ago
Process: 819 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 839 (ntpd)
CGroup: /system.slice/ntpd.service
└─839 /usr/sbin/ntpd -u ntp:ntp -g

Re: [Solved] NTPD will not start at boot

Posted: 2017/06/18 18:16:42
by dgtadmin
Another thank you, as this solved my ntpd boot time issues as well.

thanks

Re: [Solved] NTPD will not start at boot

Posted: 2019/12/10 23:15:01
by cbridgeman
This resolved my problem too! Thanks for the help, I was banging my head against the wall.

Re: [Solved] NTPD will not start at boot

Posted: 2019/12/17 15:59:45
by KernelOops
Just a quick note, ntpd has been deprecated and that is why centos prefers chronyd by default. Since chronyd is a replacement for ntpd and offers much better time sync (especially on virtual environments), maybe you should consider using chronyd over ntpd.

Re: [Solved] NTPD will not start at boot

Posted: 2019/12/17 18:03:24
by MartinR
Another quick note: ntpd has gone from the C8 repositories so you are forced to use chronyd.