[CentOS] Systemd

Sun May 24 18:41:43 UTC 2015
Kirk Bocek <t004 at kbocek.com>


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!