输入sudo systemctl start ntpd,有以下问题

AAA@master:~$ sudo systemctl start ntpd
Failed to start ntpd.service: Unit ntpd.service not found.

Failed to start ntpd.service: Unit ntpd.service not found.
启动ntpd.service失败: 没有找到服务Unit ntpd 。

(1)首先看一下服务列表里有没有ntpd.service服务:

AAA@master:~$ systemctl list-unit-files --type=service | grep ntpd*
ntp-systemd-netif.service                  static
ntp.service                                disabled

AAA@master:~$ systemctl list-unit-files --type=service | grep ntpd*
ntp-systemd-netif.service                  static
ntp.service                                disabled

从输出的结果上来看,系统存在ntp.service服务,尽管其的状态是disabled。

重启服务:

AAA@master:~$ systemctl daemon-reload
==== AUTHENTICATING FOR org.freedesktop.systemd1.reload-daemon ===
重新载入 systemd 状态需要认证。
Authenticating as: AAA,,, (AAA)
Password:
==== AUTHENTICATION COMPLETE ===

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐