The NTP service setting fails to start automatically after booting

foreword

The Linux server has set ntpd to start automatically at startup, but restarting the server ntpd does not start automatically

1. The reason why the NTP service setting fails to start automatically after booting

reason:chrony服务与NTP服务冲突导致开机启动未生效

Two, the solution

  1. Turn off the self-starting of the chrony service

    #关闭chrony服务的自启动
    systemctl disable chronyd.service
    

    insert image description here

  2. View the startup status of the chrony service

    #查看chrony服务的启动状态设置(disabled代表关闭)
    systemctl  is-enabled chronyd
    

    insert image description here

  3. Start the NTP service

    systemctl start ntpd
    

    insert image description here

  4. View the startup status of the NTP service

    systemctl status ntpd
    

    insert image description here

  5. Set the NTP service to start automatically at boot

    systemctl enable ntpd
    

    insert image description here

  6. Restart the server to test whether the NTP service is normal and self-starting

Guess you like

Origin blog.csdn.net/weixin_44904239/article/details/131439624