[Solved] NTPD will not start at boot

General support questions
Post Reply
thepo6
Posts: 2
Joined: 2016/07/18 12:10:41

[Solved] NTPD will not start at boot

Post by thepo6 » 2016/07/18 20:22:23

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.
Last edited by thepo6 on 2016/07/19 11:43:49, edited 1 time in total.

larwood
Posts: 60
Joined: 2011/07/27 12:07:30
Location: Perth WA, Australia

Re: NTPD will not start at boot

Post by larwood » 2016/07/19 06:46:28

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.

thepo6
Posts: 2
Joined: 2016/07/18 12:10:41

Re: NTPD will not start at boot

Post by thepo6 » 2016/07/19 11:41:45

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

dgtadmin
Posts: 1
Joined: 2014/10/08 02:41:17

Re: [Solved] NTPD will not start at boot

Post by dgtadmin » 2017/06/18 18:16:42

Another thank you, as this solved my ntpd boot time issues as well.

thanks

cbridgeman
Posts: 1
Joined: 2019/05/15 03:30:53

Re: [Solved] NTPD will not start at boot

Post by cbridgeman » 2019/12/10 23:15:01

This resolved my problem too! Thanks for the help, I was banging my head against the wall.

User avatar
KernelOops
Posts: 265
Joined: 2013/12/18 15:04:03
Location: xfs file system

Re: [Solved] NTPD will not start at boot

Post by KernelOops » 2019/12/17 15:59:45

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.
--
I love my computer - all my friends live there.
--

MartinR
Posts: 578
Joined: 2015/05/11 07:53:27
Location: UK

Re: [Solved] NTPD will not start at boot

Post by MartinR » 2019/12/17 18:03:24

Another quick note: ntpd has gone from the C8 repositories so you are forced to use chronyd.

Post Reply

Return to “CentOS 7 - General Support”