날짜는 설정된 시간에 적용되지 않습니다.

날짜는 설정된 시간에 적용되지 않습니다.

나는 다음 명령을 사용합니다.

$ sudo date
Sat Dec 10 23:13:11 IRST 2016
$ sudo date -s '2009-02-13 11:31:30'
Fri Feb 13 11:31:30 IRST 2009
$ sudo date
Sat Dec 10 23:13:18 IRST 2016

하지만 내 날짜와 시간은 변경되지 않습니다. 내 프로세스는 다음과 같습니다.

$ ps -e
  PID TTY          TIME CMD
    1 ?        00:00:02 systemd
    2 ?        00:00:00 kthreadd
    3 ?        00:00:00 ksoftirqd/0
    5 ?        00:00:00 kworker/0:0H
    7 ?        00:00:06 rcu_sched
    8 ?        00:00:00 rcu_bh
    9 ?        00:00:00 migration/0
   10 ?        00:00:00 watchdog/0
   11 ?        00:00:00 kdevtmpfs
   12 ?        00:00:00 netns
   13 ?        00:00:00 perf
   14 ?        00:00:00 khungtaskd
   15 ?        00:00:00 writeback
   16 ?        00:00:00 ksmd
   17 ?        00:00:04 khugepaged
   18 ?        00:00:00 crypto
   19 ?        00:00:00 kintegrityd
   20 ?        00:00:00 bioset
   21 ?        00:00:00 kblockd
   22 ?        00:00:00 ata_sff
   23 ?        00:00:00 md
   24 ?        00:00:00 devfreq_wq
   27 ?        00:00:02 kswapd0
   28 ?        00:00:00 vmstat
   29 ?        00:00:00 fsnotify_mark
   30 ?        00:00:00 ecryptfs-kthrea
   46 ?        00:00:00 kthrotld
   47 ?        00:00:00 acpi_thermal_pm
   48 ?        00:00:00 bioset
   49 ?        00:00:00 bioset
   50 ?        00:00:00 bioset
   51 ?        00:00:00 bioset
   52 ?        00:00:00 bioset
   53 ?        00:00:00 bioset
   54 ?        00:00:00 bioset
   55 ?        00:00:00 bioset
   56 ?        00:00:00 bioset
   57 ?        00:00:00 bioset
   58 ?        00:00:00 bioset
   59 ?        00:00:00 bioset
   60 ?        00:00:00 bioset
   61 ?        00:00:00 bioset
   62 ?        00:00:00 bioset
   63 ?        00:00:00 bioset
   64 ?        00:00:00 bioset
   65 ?        00:00:00 bioset
   66 ?        00:00:00 bioset
   67 ?        00:00:00 bioset
   68 ?        00:00:00 bioset
   69 ?        00:00:00 bioset
   70 ?        00:00:00 bioset
   71 ?        00:00:00 bioset
   77 ?        00:00:00 ipv6_addrconf
   91 ?        00:00:00 deferwq
   92 ?        00:00:00 charger_manager
  129 ?        00:00:00 bioset
  130 ?        00:00:00 bioset
  131 ?        00:00:00 bioset
  132 ?        00:00:00 bioset
  133 ?        00:00:00 bioset
  134 ?        00:00:00 bioset
  135 ?        00:00:00 scsi_eh_0
  136 ?        00:00:00 bioset
  137 ?        00:00:00 scsi_tmf_0
  138 ?        00:00:00 bioset
  139 ?        00:00:00 scsi_eh_1
  140 ?        00:00:00 scsi_tmf_1
  141 ?        00:00:00 scsi_eh_2
  142 ?        00:00:00 scsi_tmf_2
  143 ?        00:00:00 scsi_eh_3
  144 ?        00:00:00 scsi_tmf_3
  146 ?        00:00:00 scsi_eh_4
  148 ?        00:00:00 scsi_tmf_4
  151 ?        00:00:00 scsi_eh_5
  152 ?        00:00:00 scsi_tmf_5
  156 ?        00:00:00 kfd_process_wq
  157 ?        00:00:00 ttm_swap
  158 ?        00:00:00 radeon-crtc
  159 ?        00:00:00 radeon-crtc
  160 ?        00:00:00 bioset
  182 ?        00:00:00 kworker/0:1H
  184 ?        00:00:00 jbd2/sda1-8
  185 ?        00:00:00 ext4-rsv-conver
  220 ?        00:00:00 systemd-journal
  222 ?        00:00:00 kauditd
  272 ?        00:00:00 systemd-udevd
  429 ?        00:00:00 systemd-timesyn
  435 ?        00:00:00 edac-poller
  523 ?        00:00:00 kvm-irqfd-clean
  601 ?        00:00:00 whoopsie
  607 ?        00:00:00 rsyslogd
  610 ?        00:00:00 acpid
  617 ?        00:00:00 avahi-daemon
  623 ?        00:00:00 ModemManager
  636 ?        00:00:01 dbus-daemon
  673 ?        00:00:00 avahi-daemon
  685 ?        00:00:00 NetworkManager
  690 ?        00:00:00 snapd
  696 ?        00:00:00 systemd-logind
  699 ?        00:00:00 cups-browsed
  702 ?        00:00:00 cron
  703 ?        00:00:00 accounts-daemon
  789 ?        00:00:00 polkitd
  833 ?        00:00:00 lightdm
  850 tty7     00:05:44 Xorg
  862 ?        00:00:00 php-fpm7.0
  865 ?        00:00:00 php-fpm7.0
  866 ?        00:00:00 php-fpm7.0
  868 ?        00:00:00 dhclient
  881 ?        00:00:00 dnsmasq
 1121 tty1     00:00:00 agetty
 1145 ?        00:00:00 iprt-VBoxWQueue
 1181 ?        00:00:00 rtkit-daemon
 1212 ?        00:00:00 lightdm
 1267 ?        00:00:00 systemd
 1270 ?        00:00:00 (sd-pam)
 1275 ?        00:00:00 gnome-keyring-d
 1277 ?        00:00:00 upstart
 1341 ?        00:00:00 upstart-udev-br
 1348 ?        00:00:01 dbus-daemon
 1417 ?        00:00:00 gpg-agent
 1420 ?        00:00:00 upstart-dbus-br
 1422 ?        00:00:00 upstart-dbus-br
 1425 ?        00:00:00 upstart-file-br
 1435 ?        00:00:00 sh
 1446 ?        00:00:00 xfce4-session
 1453 ?        00:00:00 xfconfd
 1459 ?        00:00:37 xfwm4
 1463 ?        00:00:25 xfce4-panel
 1467 ?        00:00:11 xfdesktop
 1468 ?        00:00:01 blueman-applet
 1471 ?        00:00:00 update-notifier
 1476 ?        00:00:02 pulseaudio
 1478 ?        00:00:00 polkit-gnome-au
 1479 ?        00:00:00 light-locker
 1480 ?        00:00:00 nm-applet
 1485 ?        00:00:00 xfce4-volumed
 1486 ?        00:00:00 applet.py
 1492 ?        00:00:00 at-spi-bus-laun
 1496 ?        00:00:00 gvfsd
 1501 ?        00:00:00 gvfsd-fuse
 1505 ?        00:00:00 dbus-daemon
 1513 ?        00:00:01 at-spi2-registr
 1517 ?        00:00:00 xfce4-power-man
 1518 ?        00:00:01 xfsettingsd
 1521 ?        00:00:00 upowerd
 1577 ?        00:00:00 dconf-service
 1598 ?        00:00:00 gvfs-udisks2-vo
 1602 ?        00:00:00 udisksd
 1604 ?        00:00:00 panel-14-places
 1609 ?        00:00:00 panel-16-screen
 1614 ?        00:00:00 gvfs-goa-volume
 1620 ?        00:00:00 gvfs-mtp-volume
 1621 ?        00:00:03 xfce4-xkb-plugi
 1626 ?        00:00:00 gvfs-afc-volume
 1627 ?        00:00:00 panel-4-systray
 1632 ?        00:00:04 panel-10-cpugra
 1634 ?        00:00:00 gvfs-gphoto2-vo
 1635 ?        00:00:02 panel-19-weathe
 1661 ?        00:00:00 upstart
 1663 ?        00:00:00 indicator-messa
 1664 ?        00:00:00 indicator-sound
 1672 ?        00:00:00 indicator-appli
 1727 ?        00:00:00 obexd
 1807 ?        00:00:00 dbus-daemon
 1839 ?        00:00:01 panel-6-indicat
 1844 ?        00:00:00 upstart
 2104 ?        00:00:00 gvfsd-metadata
 2108 ?        00:00:00 gvfsd-trash
 2198 ?        00:00:00 gconfd-2
 2240 ?        00:00:00 kworker/u4:0
 2349 ?        00:00:11 stardict
 2351 ?        00:00:00 bonobo-activati
 2563 ?        00:00:00 dbus-daemon
 2885 ?        00:00:14 xfce4-terminal
 2889 ?        00:00:00 gnome-pty-helpe
 2890 pts/0    00:00:01 bash
 2905 ?        00:00:00 dbus-daemon
 2941 ?        00:00:00 gconfd-2
 2968 ?        00:00:00 dbus-daemon
 3048 ?        00:00:00 gvfsd
 3246 ?        00:00:06 Thunar
 3438 ?        00:00:00 dbus-daemon
 3715 pts/6    00:00:00 bash
 3730 ?        00:00:00 dbus-daemon
 3800 ?        00:00:00 dbus-daemon
 3841 ?        00:05:01 firefox
 3931 ?        00:00:01 kworker/0:1
 4035 ?        00:00:00 dbus-daemon
 4048 ?        00:00:00 system-tools-ba
 4052 ?        00:00:00 SystemToolsBack
 4170 ?        00:00:00 dbus-daemon
 4253 ?        00:00:00 kworker/u4:1
 4358 ?        00:00:00 kworker/0:0
 4381 pts/7    00:00:00 bash
 4396 ?        00:00:00 dbus-daemon
 4435 ?        00:00:00 kworker/0:2
 4439 pts/6    00:00:00 ps

나는 가지고있다 xUbuntu 16.04.1 LTS:

$ uname -a
Linux wundoz 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

이 문제를 어떻게 해결하나요?

답변1

systemd-timesyncd 서비스(pid 429)가 시계를 현재 시간으로 업데이트하는 것 같습니다. 이 프로세스는 목록에 systemd-timesyn으로 표시되지만 ps 429전체 이름을 사용하면 표시됩니다.

이것을 실행하면 timedatectl status날짜와 시간에 대한 정보를 얻을 수 있습니다. 마지막으로 다음을 볼 수 있습니다:

Network time on: yes
NTP synchronized: no

systemd-timesyncd위의 "네트워크 시간"을 참조하세요.

ntp 서비스가 프로세스 목록에 없는 것 같으므로 systemd-timesyncd 서비스를 중지하면 시간/날짜를 변경할 수 있습니다.

내 컴퓨터에서는 네트워크 시간이 활성화되어 있지만 NTP는 그렇지 않습니다. 프로세스 목록에 ntp 관련 서비스(ntpdate 또는 ntpd)가 표시되지 않으므로 동일한 서비스가 귀하의 컴퓨터에 있을 것이라고 가정합니다.

systemd-timesyncd.service다음 명령을 실행하여 자세한 정보를 얻을 수 있습니다 .

#systemctl status systemd-timesyncd.service

위 명령의 출력은 아래와 같이 자동 업데이트 서버에 대한 정보를 제공합니다.

Status: "Synchronized to time server 196.10.52.57:123 (2.debian.pool.ntp.org)."

Ubuntu에서는 적어도 시작 시 ntpdate(ntpd) 서비스가 기본적으로 실행된다고 합니다. 실행 중인 ntp 서비스를 다시 확인 # top -p $(echo $(pgrep "nt") |sed 's/ /,/g')하고 실행 중인 ntp 관련 서비스가 있는지 확인할 수 있습니다(그렇지 않은 것 같습니다).

팁: 확인하면 timedatectl --help도구를 통해 시간을 설정하는 옵션이 표시됩니다 (테스트 timedatectl되지 않음 date -s).

CoreO에는좋은 기사날짜/시간 서비스에 대해

관련 정보