0

i use this command:

$ 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

but my date and time not change, my Proccess:

$ 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

i have 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

how to fix this?

  • i no want change hwclock time and date – بارپابابا Dec 10 '16 at 19:49
  • 1
    @JimFell the answers there recommend doing exactly what the OP has already done. I don't see how this is a dupe. – terdon Feb 17 at 13:56
3

It seems that it is the systemd-timesyncd service (pid 429) that updates your clock to current time. This process appears in your list as systemd-timesyn , but if you ps 429 the full name will appear.

By running timedatectl status you should get info about date and time. At the end you will see :

Network time on: yes
NTP synchronized: no

systemd-timesyncd refers to "Network time" above.

It seems that ntp services are not present in your process list, so by stopping systemd-timesyncd service you should be able to change time/date.

In my machine Network time is active, while NTP is not; I suppose you will have the same in your machine, since i can not see any ntp related service in your process list (ntpdate or ntpd)

You can get more info about systemd-timesyncd.service by running:

#systemctl status systemd-timesyncd.service

The output of above command will give you info about the auto updating servers, like this :

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

In Ubuntu it is said that ntpdate (ntpd) service could be running by default, at least at boot time. You can make a double check for possibly running ntp services with # top -p $(echo $(pgrep "nt") |sed 's/ /,/g') and look if something related to ntp is running (i dont think so)

Tip: If you check timedatectl --help you will see options to set time by timedatectl tool, which might work better by date -s (not tested)

CoreOs has a nice article about date/time services.

  • @Babyy : Did this worked? – George Vasiliou Dec 12 '16 at 22:02
  • i use this command for temporary stop this service sudo systemctl stop systemd-timesyncd, thank you – بارپابابا Dec 17 '16 at 3:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.