www.zyun.jp

systemd timesyncd

ntpクライアントをインストールした覚えなかったけど、時刻が合ってたので調べてみたらsystemd-timesyncdが有効になってました。

$ chronyc sources
210 Number of sources = 8
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
^- golem.canonical.com           2  10   377   753  +7506us[+7453us] +/-  138ms
^- chilipepper.canonical.com     2  10   377   706  -6768us[-6820us] +/-  153ms
^- alphyn.canonical.com          2  10   377   133    -45ms[  -45ms] +/-  185ms
^- pugot.canonical.com           2  10   177   287  -7940us[-7940us] +/-  147ms
^+ x.ns.gin.ntt.net              2  10   377     5  -1457us[-1457us] +/-   74ms
^* kuroa.me                      2  10   377   569    -45us[  -97us] +/-   35ms
^+ x.ns.gin.ntt.net              2  10   377  1013  -3102us[-3153us] +/-   74ms
^+ time.cloudflare.com           3  10   377   28m  +5823us[+5739us] +/-   80ms
$ timedatectl
                      Local time: Tue 2020-08-18 00:09:00 UTC
                  Universal time: Tue 2020-08-18 00:09:00 UTC
                        RTC time: Tue 2020-08-18 00:09:00
                       Time zone: Etc/UTC (UTC, +0000)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: no
$ timedatectl --version
systemd 237
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid

zyun@pisces:~$ timedatectl
                      Local time: Tue 2020-08-18 00:29:10 UTC
                  Universal time: Tue 2020-08-18 00:29:10 UTC
                        RTC time: Tue 2020-08-18 00:29:09
                       Time zone: Etc/UTC (UTC, +0000)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: no
zyun@pisces:~$ timedatectl --help
timedatectl [OPTIONS...] COMMAND ...

Query or change system time and date settings.

  -h --help                Show this help message
     --version             Show package version
     --no-pager            Do not pipe output into a pager
     --no-ask-password     Do not prompt for password
  -H --host=[USER@]HOST    Operate on remote host
  -M --machine=CONTAINER   Operate on local container
     --adjust-system-clock Adjust system clock when changing local RTC mode

Commands:
  status                   Show current time settings
  set-time TIME            Set system time
  set-timezone ZONE        Set system time zone
  list-timezones           Show known time zones
  set-local-rtc BOOL       Control whether RTC is in local time
  set-ntp BOOL             Enable or disable network time synchronization
zyun@pisces:~$

$ timedatectl
               Local time: Tue 2020-08-18 09:20:35 JST
           Universal time: Tue 2020-08-18 00:20:35 UTC
                 RTC time: Tue 2020-08-18 00:20:36
                Time zone: Asia/Tokyo (JST, +0900)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no
$ timedatectl --version
systemd 245 (245.4-4ubuntu3.2)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid

ubuntu@tucana:~/ > timedatectl --help
timedatectl [OPTIONS...] COMMAND ...

Query or change system time and date settings.

Commands:
  status                   Show current time settings
  show                     Show properties of systemd-timedated
  set-time TIME            Set system time
  set-timezone ZONE        Set system time zone
  list-timezones           Show known time zones
  set-local-rtc BOOL       Control whether RTC is in local time
  set-ntp BOOL             Enable or disable network time synchronization

systemd-timesyncd Commands:
  timesync-status          Show status of systemd-timesyncd
  show-timesync            Show properties of systemd-timesyncd

Options:
  -h --help                Show this help message
     --version             Show package version
     --no-pager            Do not pipe output into a pager
     --no-ask-password     Do not prompt for password
  -H --host=[USER@]HOST    Operate on remote host
  -M --machine=CONTAINER   Operate on local container
     --adjust-system-clock Adjust system clock when changing local RTC mode
     --monitor             Monitor status of systemd-timesyncd
  -p --property=NAME       Show only properties by this name
  -a --all                 Show all properties, including empty ones
     --value               When showing properties, only print the value

See the timedatectl(1) man page for details.
ubuntu@tucana:~/ >

← Back to Blog