即使已启用 ntpd,它也不会在系统启动时启动。我可以发出“systemctl start ntpd”命令,该命令将成功启动 ntpd,但重新启动后 ntpd.service 变为非活动状态(死机)。单元文件和 ntpd.conf 文件与同一发行版 RHEL 7.5 上的工作服务器匹配。Selinux 也已禁用。有什么想法吗?
Systemd 单元文件:
# systemctl status ntpd
● ntpd.service - Network Time Service
Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
Active: inactive (dead)
# cat /usr/lib/systemd/system/ntpd.service
[Unit]
Description=Network Time Service
After=syslog.target ntpdate.service sntp.service
[Service]
Type=forking
EnvironmentFile=-/etc/sysconfig/ntpd
ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS
PrivateTmp=true
[Install]
WantedBy=multi-user.target
# cat /etc/sysconfig/ntpd
# Command line options for ntpd
OPTIONS="-g"
ntp.conf 文件:
# cat /etc/ntp.conf
driftfile /var/lib/ntp/drift
server 10.227.204.142 # added by /sbin/dhclient-script
server 10.235.48.111 # added by /sbin/dhclient-script
server 10.60.248.183 # added by /sbin/dhclient-script
答案1
需要禁用 chronyd.service,以便 ntpd.service 在系统启动时启动