Ubuntu 如何列出*所有*运行时同步服务

Ubuntu 如何列出*所有*运行时同步服务,ubuntu,ntp,Ubuntu,Ntp,我有一个Ubuntu盒,我想设置一个NTP时间同步。决定和chrony一起去。我想确保没有其他现成的时间同步服务正在运行 我运行了sudo服务状态,所有服务都没有弹出。但是有没有更彻底的方法来检查没有时间同步在运行?我不满意的原因是timedatectl正在运行,但它在上面的列表中并没有生成任何可见的服务——好吧,反正和timedatectl没有任何相似之处 John:~$ timedatectl Local time: Sat 2018-08-18 04:29:15 UTC Unive

我有一个Ubuntu盒,我想设置一个NTP时间同步。决定和chrony一起去。我想确保没有其他现成的时间同步服务正在运行

我运行了sudo服务状态,所有服务都没有弹出。但是有没有更彻底的方法来检查没有时间同步在运行?我不满意的原因是timedatectl正在运行,但它在上面的列表中并没有生成任何可见的服务——好吧,反正和timedatectl没有任何相似之处

John:~$ timedatectl
  Local time: Sat 2018-08-18 04:29:15 UTC
  Universal time: Sat 2018-08-18 04:29:15 UTC
  RTC time: Sat 2018-08-18 04:29:15
  Time zone: Etc/UTC (UTC, +0000)
  Network time on: yes
  NTP synchronized: yes
  RTC in local TZ: no

一种选择是查看netstat结果,看看是否有任何东西绑定到ntp端口

通过使用netstat-a,您应该会得到与下面类似的结果

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State           
udp        0      0 vm0:ntp                     *:*                                     
udp        0      0 localhost.localdomain:ntp   *:*                                     
udp        0      0 *:ntp                       *:*                                     
udp        0      0 fe80::ffff:ffff:ffff:ffff:ntp *:*                                     
udp        0      0 localhost.localdomain:ntp   *:*                                     
udp        0      0 *:ntp                       *:*                                     
注意带有“ntp”或任何绑定到端口123的线路。这将告诉你,你有一些运行和积极的。我看不到允许您检查哪个程序或进程绑定到端口的快速命令,但您可以通过-p查看创建套接字的内容以查看PID和程序名