Killertechno
Posts: 176
Joined: Wed Jan 02, 2013 8:28 am

How disable system time update?

Wed Apr 03, 2019 11:18 pm

Hi to all, I'm making tests using DS3231 RTC and GPS receiver.
At boot I write into DS3231 date from GPS receiver (starting at 1 Jan 2000), but when accessing to Raspberry through ssh I can see system time and RTC time are updated to 2019.
Disabling internet access on router I can correctly find RTC date at 1 Jan 2000.

I removed hwclock and ntp (sudo apt-get remove ntp, sudo apt-get remove fake-hwclock) and renamed ntp.conf to _ntp.conf.

I still find updated time when internet connection available.

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.14.34+ #1110 Mon Apr 16 14:51:42 BST 2018 armv6l GNU/Linux
pi@raspberrypi:~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 9.4 (stretch)
Release: 9.4
Codename: stretch
pi@raspberrypi:~ $
How can I do to disable updating system time?
Thanks.

DirkS
Posts: 9902
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: How disable system time update?

Wed Apr 03, 2019 11:41 pm

Stretch does not use ntp. Sync is organised by the systemd-timesyncd service.
To disable it use

Code: Select all

sudo systemctl stop systemd-timesyncd
sudo systemctl disable systemd-timesyncd

Andyroo
Posts: 4213
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: How disable system time update?

Thu Apr 04, 2019 12:43 am

Unless my math is out (and it could be) that chip could loose 3 minutes a year depending on temp.

I would be interested to know how you get on with it :)
Need Pi spray - these things are breeding in my house...

Killertechno
Posts: 176
Joined: Wed Jan 02, 2013 8:28 am

Re: How disable system time update?

Thu Apr 04, 2019 10:19 am

Andyroo wrote:
Thu Apr 04, 2019 12:43 am
Unless my math is out (and it could be) that chip could loose 3 minutes a year depending on temp.

I would be interested to know how you get on with it :)
Yes, maximum drift would be 63 seconds (within 0 to 40 °C), or 110 seconds (-40 to 85 °C) after 1 year (365 days).
I check sync alignment with GPS every 3 hours.

Killertechno
Posts: 176
Joined: Wed Jan 02, 2013 8:28 am

Re: How disable system time update?

Thu Apr 04, 2019 2:51 pm

sudo systemctl stop systemd-timesyncd
sudo systemctl disable systemd-timesyncd

Still getting time updated when internet available....

epoch1970
Posts: 3565
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: How disable system time update?

Thu Apr 04, 2019 3:48 pm

I would try the "timedatectl" command
I believe there is a chance systemd-timesyncd might be revived in some cases, e.g. ntp server info provided via DHCP.
https://wiki.archlinux.org/index.php/systemd-timesyncd
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Return to “General programming discussion”