On 5/23/2015 11:22 PM, Luigi Rosa wrote:> Kirk Bocek wrote on 24/05/2015 04:37: >> So I've built my first CentOS 7 host and am learning all the new ways >> of doing >> things. I setup and enabled ntpd but after a reboot I get: > > In CentOS 7 is bettere to use chrony, here's an howto > > http://linoxide.com/linux-command/chrony-time-sync/ >So reviewing Red Hat's documentation on the subject: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/chap-Configuring_the_Date_and_Time.html#sect-Configuring_the_Date_and_Time-timedatectl-NTP I see both chrony and ntpd mentioned but no preference given. Seeing that I've used ntpd for a decade and am more comfortable an familiar with it, I think I just stick with ntpd. However, we have yet *another* new control system. We are supposed to issue: $timedatectl set-ntp yes to activate your selected daemon. I just used the new systemd commands, thinking that would be enough. So I tried that and rebooted. Nope, same problem: $systemctl status ntpd ntpd.service - Network Time Service Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled) Active: inactive (dead) I have also tried: $systemctl reenable ntpd To get the symbolic links rewritten. No help. To be clear, if I manually issue: $systemctl start ntpd ntpd runs fine: $systemctl status ntpd ntpd.service - Network Time Service Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled) Active: active (running) since Sun 2015-05-24 11:39:21 PDT; 8s ago Process: 2935 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status=0/SUCCESS) Main PID: 2936 (ntpd) CGroup: /system.slice/ntpd.service ??2936 /usr/sbin/ntpd -u ntp:ntp -g May 24 11:39:21 cobalt ntpd[2936]: Listen normally on 3 enp4s0f0 10.0.0.160 UDP 123 May 24 11:39:21 cobalt ntpd[2936]: Listen normally on 4 lo ::1 UDP 123 May 24 11:39:21 cobalt ntpd[2936]: Listen normally on 5 enp4s0f0 fe80::ec4:7aff:fe34:1dcc UDP 123 May 24 11:39:21 cobalt ntpd[2936]: Listening on routing socket on fd #22 for interface updates May 24 11:39:21 cobalt ntpd[2936]: io_setbclient: Opened broadcast client on interface #3 enp4s0f0 May 24 11:39:21 cobalt ntpd[2936]: Listen normally on 6 multicast 224.0.1.1 UDP 123 May 24 11:39:21 cobalt ntpd[2936]: Joined 224.0.1.1 socket to multicast group 224.0.1.1 May 24 11:39:21 cobalt ntpd[2936]: 0.0.0.0 c016 06 restart May 24 11:39:21 cobalt ntpd[2936]: 0.0.0.0 c012 02 freq_set kernel 17.232 PPM May 24 11:39:22 cobalt ntpd[2936]: 0.0.0.0 c515 05 clock_sync It's just not running at boot time. Come on, I can't be the only one here to setup time services!
On Sun, 24 May 2015 11:41:43 -0700 Kirk Bocek wrote:> It's just not running at boot time. Come on, I can't be the only one > here to setup time services!Every Centos 7 installation that I've done so far installs and activates chrony by default, without any particular action required on my part at all. -- MELVILLE THEATRE ~ Real D 3D Digital Cinema ~ www.melvilletheatre.com
On 05/24/2015 11:41 AM, Kirk Bocek wrote:> to activate your selected daemon. I just used the new systemd commands, > thinking that would be enough. So I tried that and rebooted. Nope, same > problem:chronyd and ntpd both use UDP port 123, so each will terminate the other when it starts. If both are enabled, chronyd's unit file indicates that it should start after ntpd, so it will always "win." You probably have both enabled, so the system boots, starts ntpd, then starts chronyd which terminates ntpd. Disable chronyd.
On 5/24/2015 12:22 PM, Gordon Messmer wrote:> On 05/24/2015 11:41 AM, Kirk Bocek wrote: >> to activate your selected daemon. I just used the new systemd commands, >> thinking that would be enough. So I tried that and rebooted. Nope, same >> problem: > > chronyd and ntpd both use UDP port 123, so each will terminate the > other when it starts. If both are enabled, chronyd's unit file > indicates that it should start after ntpd, so it will always "win." > > You probably have both enabled, so the system boots, starts ntpd, then > starts chronyd which terminates ntpd. > > Disable chronyd. >Yes, indeedy. $systemctl status chronyd chronyd.service - NTP client/server Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled) Active: inactive (dead) since Sun 2015-05-24 11:39:21 PDT; 3h 31min ago Process: 845 ExecStartPost=/usr/libexec/chrony-helper add-dhclient-servers (code=exited, status=0/SUCCESS) Process: 808 ExecStart=/usr/sbin/chronyd -u chrony $OPTIONS (code=exited, status=0/SUCCESS) Main PID: 814 (code=exited, status=0/SUCCESS) CGroup: /system.slice/chronyd.service May 24 11:35:53 cobalt chronyd[814]: NTP packet received from unauthorised host 10.0.0.1 port 123 ... So: $rpm -e --nodeps chrony chrony has dependencies with anaconda and initial-setup. Reboot, and: $systemctl status ntpd ntpd.service - Network Time Service Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled) Active: active (running) since Sun 2015-05-24 15:15:42 PDT; 3min 1s ago Process: 847 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status=0/SUCCESS) Main PID: 868 (ntpd) CGroup: /system.slice/ntpd.service ??868 /usr/sbin/ntpd -u ntp:ntp -g May 24 15:15:42 cobalt ntpd[868]: Failed to join 224.0.1.1 socket to multicast group 224.0.1.1 May 24 15:15:42 cobalt ntpd[868]: 0.0.0.0 c016 06 restart May 24 15:15:42 cobalt ntpd[868]: 0.0.0.0 c012 02 freq_set kernel 17.232 PPM May 24 15:15:43 cobalt ntpd[868]: 0.0.0.0 c515 05 clock_sync May 24 15:15:49 cobalt ntpd[868]: Listen normally on 5 enp4s0f0 fe80::ec4:7aff:fe34:1dcc UDP 123 May 24 15:15:49 cobalt ntpd[868]: new interface(s) found: waking up resolver May 24 15:15:51 cobalt ntpd[868]: Listen normally on 6 enp4s0f0 10.0.0.160 UDP 123 May 24 15:15:51 cobalt ntpd[868]: io_setbclient: Opened broadcast client on interface #6 enp4s0f0 May 24 15:15:51 cobalt ntpd[868]: new interface(s) found: waking up resolver May 24 15:16:47 cobalt ntpd[868]: 0.0.0.0 0613 03 spike_detect +0.416806 s Multicast error, but no big deal. ntpq -p is reporting correctly on the broadcast servers on my network. Also, I suppose I could have just disabled chrony instead of removing it. I had no idea about chrony and no idea it was installed *and activated* by default. So much new stuff to learn in 7. Thank you Frank and Gordon.