Turn off ntp client

Just noticed that I'm not able to turn the NTP client off anymore in 18.06.4 on an TL-WR741ND v4
Under LuCI, menu System:
Time Synchronization
Enable NTP client - this one stays enabled all the time, cannot switch it off
Provide NTP server - disabled

In /etc/config/system, config timeserver 'ntp' section, I added:
option enabled '0'
option enable_server '0'

Restarted the router, checked if the options I added in /etc/config/system were persistent, positive, and noticed that the router still got the time synchronized.

I believe this is a bug, in my use case a very serious one, and I'm thankful for any suggestions on how to disable the NTP sync.

Thanks in advance!

P.S. Inspiration

I was able to turn off my ntp client and server.
Can you verify that you have enough space in flash? Your device has only 4MB of flash, so this could be an issue.
Alternatively you could disable the sysntpd service from startup, or assign a bogus IP as ntp server.


Thanks for the reply. I reported this issue in the 18.06.4 thread because it's after I upgraded from 18.06.2, by preserving the configuration, I observed this time sync issue.

Yep, it only has 4MB flash but I'm left with 68KB free space and in my original report I described that I checked if my changes in /etc/config/system remained persistent (after the reboot), result was positive.

Just for the record:

LuCI System>Software reporting:
Free space: 21% (68.00 KB)

df output:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 2304 2304 0 100% /rom
tmpfs 13920 572 13348 4% /tmp
/dev/mtdblock3 320 252 68 79% /overlay
overlayfs:/overlay 320 252 68 79% /
tmpfs 512 0 512 0% /dev

/etc/config/system ntp section:

config timeserver 'ntp'
option enabled '0'
option enable_server '0'
list server '0.openwrt.pool.ntp.org'
list server '1.openwrt.pool.ntp.org'
list server '2.openwrt.pool.ntp.org'
list server '3.openwrt.pool.ntp.org'

I went in LuCI and tried again to disable the "Enable NTP client ", unchecked the box, pressed Save & Apply and now it stays disabled. It didn't before, before the reboot I reported in my original post.

However, when I reboot / power cycle the router, I get accurate time when I log into LuCI / ssh to the router and run date. There's no entry in the log about the time sync and I'm using PPPoE for my internet connection.
Since this router has no RTC & battery, I suspect it's saving the timestamp somewhere before the reboot/power cycle. 18.06.2 had no accurate time when it booted.

Thanks for the tips with disabling NTP - I already considered setting up bogus NTP servers for the sync.

P.S. The autoformatting makes using this forum a horrifying experience, worse than Redmond Word! Is there any possibility to disable the whole thing? Are there Redmond engineers designing the forum backend?

Ok, so I suspected that there's some sort of automatic Browser Time Sync in LuCI. Avoided to access the router through LuCI after a reboot and instead connected to it over ssh and ran date.
Also excluded the possibility to autosync the time during the PPPoE handshake/connection and went on and power cycled the router (waited 1 minute before powering on again).

date output:
before the power cycle:
Thu Jul 18 21:22:11 EEST 2019
after the power cycle:
Thu Jul 18 21:12:08 EEST 2019

Which means NTP is not used and the date is picked by OpenWRT from some place (timestamp of a file?).
My LuCI issue disabling NTP is resolved, it woks now, magically...
I'll set this on resolved.

Please use "Preformatted text </>" for logs, scripts, configs and general console output.

I agree with you: If you are not used to it, simply copy&pasting can produce unexpected results. :slight_smile:

1 Like

The initial clock setting logic is indeed based on searching the filesystem (at least /etc) to find the timestamp of the latest modified file. That time is copied to the system clock.


This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.