5

I've noticed that some embedded devices (such as OpenWRT, which runs on Busybox) use rdate to set the system time, instead of NTP. Rdate is an older time protocol, and I'm having trouble finding any working rdate servers in the United States.

Is it possible to for rdate to sync the time with NTP time servers?

Stefan Lasiewski
  • 22,949
  • 38
  • 129
  • 184
  • +1, Good luck. "older protocol" is being pretty nice as the protocol was formalized 27 years ago, and was used before that. Perhaps finding a Daytime protocol server, they might run both protocols (Daytime was a very similar service, but human readable instead of a binary number of seconds). – Chris S Jul 01 '10 at 15:22
  • It's true that rdate/time is an obsoleted protocol, but this how [OpenWrt sets the time by default](http://wiki.openwrt.org/doc/uci/timeserver), due to space considerations. – Stefan Lasiewski Jun 29 '11 at 22:18

4 Answers4

7

Most of these public servers still accept TIME requests, the protocol used by rdate.

etheros
  • 294
  • 1
  • 8
5

The rdate you have is a busybox applet that only speaks rdate, so no, it's not possible.

Your other option is to install an ntp client or an sntp (simple ntp) client, or to upgrade busybox to a version that has the ntpd applet. I don't know what packages are available to you, but ntp and msntp (both daemons) and ntpdate, bsd rdate (both one shot, the latter does speak sntp) are the options I see on debian.

Tobu
  • 4,367
  • 1
  • 23
  • 31
5

Have you considered setting up your own server? Just setup a NTP on a publically accessible box, point it at a few good ntp servers. Setup the standard time service on your server. On a linux box you would need to install inetd if you don't have it, and then uncomment the time service in the /etc/inetd.conf. On a windows box you need to add the 'Simple TCP/IP services' feature.

Keep in mind that rdate is not really that good of a time service. Installing an sntp/ntp client will probably be a better choice if you need reliable time.

Zoredache
  • 128,755
  • 40
  • 271
  • 413
3

You can supply an rdate source from Unix (Linux) using either inetd or xinetd. The server is built in to both these servers.

Where possible, use ntp as noted above. Your ISP's DNS servers are likely to provide NTP services. These are likely closer on the net than any other servers. As suggested above, you should consider setting up an NTP server on your network.

OpenWRT has an ntp package, and can be uses as your NTP server.

BillThor
  • 27,354
  • 3
  • 35
  • 69
  • 1
    +1 : I didn't see the ntpclient package for OpenWRT at first. Thanks for mentioning it. I now use NTP. – Stefan Lasiewski Aug 06 '10 at 22:59
  • There is no NTP client. NTP works as both a client and server. Depending on your configuration, the server may not provide information to any clients, but it is still there. – BillThor Aug 07 '10 at 16:16
  • Thanks, that's exactly what I needed! I ended up running the equivalent of the following `opkg update && opkg install ntpclient && ACTION=ifup sh /etc/hotplug.d/iface/*ntpclient` to get it installed and running on my OpenWRT router which only had rdate support built-in. – Tim Lewis Jun 05 '14 at 02:42