Hello,
While reviewing the current OpenWrt NTP documentation, I noticed that it covers several methods to set the system time:
-
manual update via
date/busybox-date -
one-time synchronization using
ntpd -q -
persistent synchronization via
sysntpdorntpd -
legacy
rdateusage
However, there is no example showing how to update the system time via /etc/rc.local at boot.
Using /etc/rc.local can be useful in scenarios where a user wants a one-time NTP update immediately after the network is available, before sysntpd starts, or in environments where network initialization might be delayed. A minimal example could be:
#!/bin/sh
sleep 60 # wait for network
ntpd -q -p pool.ntp.org
exit 0
I think it could be helpful to document this as an optional, advanced method for users who need immediate time synchronization at boot.
My questions for the community:
-
Would including a
/etc/rc.localexample be appropriate for the documentation? -
Are there best practices or caveats that should be highlighted (e.g., waiting for network, avoiding conflicts with
sysntpd)?
I would appreciate any feedback before proposing a concrete update to the documentation.