systemd-timesyncd服务被终止且无法查询到的故障排查求助
systemd-timesyncd服务被终止且无法查询到的故障排查求助
各位好,我碰到了一个棘手的问题:systemd-timesyncd服务被终止后,现在连服务单元都找不到了,想请大家帮忙分析排查一下。下面是我整理的详细情况:
安装情况
我确认已经安装了systemd-timesyncd,执行安装命令时系统提示它已经是最新版本:
$ sudo apt -y install systemd-timesyncd Reading package lists... Done Building dependency tree... Done Reading state information... Done systemd-timesyncd is already the newest version (249.11-0ubuntu3.11pop0~1704473387~22.04~3ce38bf). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
服务状态异常
但当我尝试查看服务状态时,系统提示找不到该服务单元:
$ sudo systemctl status systemd-timesyncd Unit systemd-timesyncd.service could not be found.
从日志来看,这个服务似乎被强制终止了,但我不清楚具体原因。
日志中的关键信息
我通过journalctl查看了服务的日志,发现是watchdog超时导致服务被终止,相关日志内容如下:
$ sudo journalctl -fu systemd-timesyncd.service Jul 31 09:31:40 pop-os systemd-timesyncd[602]: Initial synchronization to time server 185.125.190.56:123 (ntp.ubuntu.com). -- Boot 67e30f40b57c4eadae6ed5a5b4df8c13 -- Jul 31 09:35:32 pop-os systemd[1]: Starting Network Time Synchronization... Jul 31 09:35:33 pop-os systemd[1]: Started Network Time Synchronization. Jul 31 09:36:03 pop-os systemd-timesyncd[660]: Initial synchronization to time server 185.125.190.56:123 (ntp.ubuntu.com). Jul 31 09:40:53 pop-os systemd[1]: systemd-timesyncd.service: Current command vanished from the unit file, execution of the command list won't be resumed. Jul 31 09:41:42 pop-os systemd[1]: systemd-timesyncd.service: Got notification message from PID 660, but reception is disabled. Jul 31 09:42:42 pop-os systemd[1]: systemd-timesyncd.service: Watchdog timeout (limit 3min)! Jul 31 09:42:42 pop-os systemd[1]: systemd-timesyncd.service: Killing process 660 (systemd-timesyn) with signal SIGABRT. Jul 31 09:42:43 pop-os systemd[1]: systemd-timesyncd.service: Main process exited, code=dumped, status=6/ABRT Jul 31 09:42:43 pop-os systemd[1]: systemd-timesyncd.service: Failed with result 'watchdog'.
timedatectl输出情况
timedatectl命令可以正常运行,输出显示NTP服务标记为active,但系统时钟并未同步:
$ timedatectl Local time: Wed 2024-01-17 15:00:42 AEDT Universal time: Wed 2024-01-17 04:00:42 UTC RTC time: Wed 2024-01-17 04:00:42 Time zone: Australia/Sydney (AEDT, +1100) System clock synchronized: no NTP service: active RTC in local TZ: no
系统环境
我使用的操作系统是Pop!_OS 22.04 LTS,具体信息如下:
$ cat /etc/os-release NAME="Pop!_OS" VERSION="22.04 LTS" ID=pop ID_LIKE="ubuntu debian" PRETTY_NAME="Pop!_OS 22.04 LTS"
更新补充
根据@paradin的提示,我发现我的系统实际上正在使用Chrony作为NTP客户端,而不是systemd-timesyncd。
备注:内容来源于stack exchange,提问作者mon
相关产品推荐
相关产品推荐

