在Linux CentOS 7.3上安装chrony服务,安装完成,启动该服务时报错 。报错信息如下所示:
[root@controller-1 ~]# systemctl start chronyd.service
Job for chronyd.service failed because the control process exited with error code. See "systemctl status chronyd.service" and "journalctl -xe" for details.
检查该服务状态未启动,查看详细信息如下所示:
[root@controller-1 ~]# journalctl -xe
--
-- The result is failed.
Feb 28 22:26:17 controller-1 systemd[1]: Unit chronyd.service entered failed state.
Feb 28 22:26:17 controller-1 systemd[1]: chronyd.service failed.
Feb 28 22:26:17 controller-1 polkitd[641]: Unregistered Authentication Agent for unix-process:11551:168977 (system bus name :1.122, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
Feb 28 22:26:20 controller-1 polkitd[641]: Registered Authentication Agent for unix-process:11562:169239 (system bus name :1.123 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UT
Feb 28 22:26:20 controller-1 polkitd[641]: Unregistered Authentication Agent for unix-process:11562:169239 (system bus name :1.123, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
Feb 28 22:30:02 controller-1 polkitd[641]: Registered Authentication Agent for unix-process:11570:191428 (system bus name :1.124 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UT
Feb 28 22:30:02 controller-1 systemd[1]: Starting NTP client/server...
-- Subject: Unit chronyd.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit chronyd.service has begun starting up.
Feb 28 22:30:02 controller-1 chronyd[11578]: chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 +DEBUG)
Feb 28 22:30:02 controller-1 chronyd[11578]: Could not change ownership of /var/run/chrony : Operation not permitted
Feb 28 22:30:02 controller-1 chronyd[11578]: Could not access /var/run/chrony : No such file or directory
Feb 28 22:30:02 controller-1 chronyd[11578]: Disabled command socket /var/run/chrony/chronyd.sock
Feb 28 22:30:02 controller-1 chronyd[11576]: Could not open /var/run/chrony/chronyd.pid : No such file or directory
Feb 28 22:30:02 controller-1 chronyd[11578]: Fatal error : Could not open /var/run/chrony/chronyd.pid : No such file or directory
Feb 28 22:30:02 controller-1 systemd[1]: chronyd.service: control process exited, code=exited status=1
Feb 28 22:30:02 controller-1 systemd[1]: Failed to start NTP client/server.
-- Subject: Unit chronyd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit chronyd.service has failed.
--
-- The result is failed.
Feb 28 22:30:02 controller-1 systemd[1]: Unit chronyd.service entered failed state.
Feb 28 22:30:02 controller-1 systemd[1]: chronyd.service failed.
Feb 28 22:30:02 controller-1 polkitd[641]: Unregistered Authentication Agent for unix-process:11570:191428 (system bus name :1.124, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
Feb 28 22:30:20 controller-1 polkitd[641]: Registered Authentication Agent for unix-process:11581:193214 (system bus name :1.125 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UT
Feb 28 22:30:20 controller-1 systemd[1]: Starting NTP client/server...
-- Subject: Unit chronyd.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit chronyd.service has begun starting up.
Feb 28 22:30:20 controller-1 chronyd[11589]: chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 +DEBUG)
Feb 28 22:30:20 controller-1 chronyd[11589]: Could not change ownership of /var/run/chrony : Operation not permitted
Feb 28 22:30:20 controller-1 systemd[1]: chronyd.service: control process exited, code=exited status=1
Feb 28 22:30:20 controller-1 chronyd[11587]: Could not open /var/run/chrony/chronyd.pid : No such file or directory
Feb 28 22:30:20 controller-1 chronyd[11589]: Could not access /var/run/chrony : No such file or directory
Feb 28 22:30:20 controller-1 systemd[1]: Failed to start NTP client/server.
-- Subject: Unit chronyd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit chronyd.service has failed.
--
-- The result is failed.
Feb 28 22:30:20 controller-1 chronyd[11589]: Disabled command socket /var/run/chrony/chronyd.sock
Feb 28 22:30:20 controller-1 systemd[1]: Unit chronyd.service entered failed state.
Feb 28 22:30:20 controller-1 chronyd[11589]: Fatal error : Could not open /var/run/chrony/chronyd.pid : No such file or directory
Feb 28 22:30:20 controller-1 systemd[1]: chronyd.service failed.
Feb 28 22:30:20 controller-1 polkitd[641]: Unregistered Authentication Agent for unix-process:11581:193214 (system bus name :1.125, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
该问题原因为:使用 yum -y install chrony命令,自动安装了最新版的chrony服务(配套7.7内核)。由于我的系统是7.3,可能不兼容高版本的chrony服务,导致服务启动失败。(个人理解猜测)
最终解决方法:了解问题原因,可采用2种方法解决:
1、使用yum -y update。将系统版本升级至最新即可解决。(我使用的此方法)
2、使用CentOS 7.3 yum源,安装兼容7.3的Chrony版本。
[root@controller-1 ~]# systemctl start chronyd
[root@controller-1 ~]# systemctl status chronyd
● chronyd.service - NTP client/server
Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2020-02-29 13:46:58 CST; 38min ago
Docs: man:chronyd(8)
man:chrony.conf(5)
Process: 726 ExecStartPost=/usr/libexec/chrony-helper update-daemon (code=exited, status=0/SUCCESS)
Process: 714 ExecStart=/usr/sbin/chronyd $OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 720 (chronyd)
CGroup: /system.slice/chronyd.service
└─720 /usr/sbin/chronyd
Feb 29 13:46:57 controller-1 systemd[1]: Starting NTP client/server...
Feb 29 13:46:57 controller-1 chronyd[720]: chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 +DEBUG)
Feb 29 13:46:57 controller-1 chronyd[720]: Frequency 0.700 +/- 46.950 ppm read from /var/lib/chrony/drift
Feb 29 13:46:58 controller-1 systemd[1]: Started NTP client/server.
Feb 29 13:47:28 controller-1 chronyd[720]: Received KoD RATE from x.x.x.x