Modify

Opened 5 years ago

Closed 4 years ago

Last modified 2 years ago

#10448 closed enhancement (fixed)

busybox-ntpd: Enable NTP server functionality in /etc/init.d/sysntpd

Reported by: dimitris@… Owned by: developers
Priority: normal Milestone: Chaos Calmer 15.05
Component: packages Version: Backfire 10.03.1 RC6
Keywords: Cc:

Description

On a just-installed Backfire RC6 on a WRT54GL, I see that I can enable busybox-ntpd to act a server, addition to a client, if I change:

local args="-n"

to

local args="-n -l "

in /etc/init.d/sysntpd.

Is this good enough to add as-is or should I try to put together a patch that also includes a config-driven switch for the server functionality?

Attachments (0)

Change History (14)

comment:1 Changed 5 years ago by Pilot6 <hanipouspilot@…>

It seems that busybox ntpd can't work as a client and server at the same time.
I have to strat another instance of ntpd with -l to get it work.

comment:2 Changed 5 years ago by dimitris@…

It seems to be doing both here. It set the time on reboot (WRT54GL, so no CMOS clock):

root@whirlpool:~# date
Fri Nov 18 09:15:21 PST 2011

And the same instance is also providing NTP service:

root@whirlpool:~# ps |grep ntpd
 1296 root      1380 S    /usr/sbin/ntpd -n -l -p 0.openwrt.pool.ntp.org -p 1.o
 3374 root      1372 S    grep ntpd 
root@whirlpool:~# ls -l /usr/sbin/ntpd 
lrwxrwxrwx    1 root     root           17 Oct 30 11:46 /usr/sbin/ntpd -> ../../bin/busybox
d@gaspode:~$ sudo ntpdate whirlpool
18 Nov 09:16:11 ntpdate[5326]: adjust time server 192.168.11.1 offset 0.076282 sec

comment:3 Changed 5 years ago by dimitris@…

BTW, the Backfire note in the wiki entry points to the initial merge (r28614) of busybox-ntpd where both client and server were disabled, however r28645 turned both of them back on and that seems to have been picked up for RC6.

Which version of oWRT/busybox are you running?

comment:4 Changed 5 years ago by cire831@…

using Backfire 10.03.1 (r29592). Have verified that -l does add server function. Single instance does do both client and server as it should. Stratum is 3 as it should be. (peered to <n>.openwrt.pool.ntp.org which are stratum 2).

With regards to making "-l" (server) configurable: Depends on if one wants the OpenWRT box keeping the port open. I don't think it would be generating any traffic. Only clients from the local net would be connecting to it. It is a listener so there isn't much overhead.

The flexible thing would be to make it configurable. I'd suggest system.ntp.servelocal=1. It would be nice to also give it a list of interfaces that it should be listening on. Not sure if that requires a change to busybox-ntpd or not. Right now is listens on the wildcard. 0.0.0.0:123. But that is firewalled on the WAN side.

I think the default should be off (so as to not generate client packets to the openwrt ntp pool). But once turned on it should serve to the local net.

comment:5 follow-up: Changed 5 years ago by hani

It seems that same instance works well from linux, but Windows machines can't get time from the same instance. Wierd.

comment:6 in reply to: ↑ 5 Changed 5 years ago by cire831@…

Replying to hani:

It seems that same instance works well from linux, but Windows machines can't get time from the same instance. Weird.

What flavor of Windows? 7?

comment:7 follow-up: Changed 5 years ago by Pilot6 <Pilot6 <hanipouspilot@…>

I never had 7 since I use linux. I have an XP partition on a desktop and a Vista on a laptop. Neither can get time from same partition. It has no practical sence for me, but stull an issue for Windows users.

comment:8 in reply to: ↑ 7 Changed 5 years ago by Eric Decker <cire831@…>

Replying to Pilot6 <Pilot6 <hanipouspilot@…>:

I never had 7 since I use linux. I have an XP partition on a desktop and a Vista on a laptop. Neither can get time from same partition. It has no practical sence for me, but stull an issue for Windows users.

what do you mean by "same partition"? Have you ever seen it work? If you run one instance of busybox-ntpd without "-l" and another instance of busybox-ntpd with "-l" does it work?

It would be good if someone with XP and other Windows boxes verify functionality.

I agree it doesn't make sense. If the ntpd server gets time properly from the upstream (which I've verified via debugging and via observation with a sniffer) and the ntpd server is listening and serving properly incoming requests on port 123 then the Windows clients should just work.
(I have also verified that operation and observed with a sniffer).

comment:9 Changed 5 years ago by Pilot6 <Pilot6 <hanipouspilot@…>

I mean that if I start ntpd with -n -l -p "server",
it syncs time with "server", but if from a windows I try to set time from router ip using standard "internet time", I gett errors. Timeout or something else.
If I start another instance of ntpd with just -l, everything works OK.

Linux comps can use same instance of ntpd with no problems.

comment:10 Changed 5 years ago by hato

I just noticed this problem myself on the wndr3700 running latest svn. The start script of busybox ntpd missing the -l option to listen on port 123. But even with this added, as already mentioned above, a windows xp client can't sync with it but a linux client sync with it just fine (a web camera) if I didn't start a separate instance of ntpd with only -l option.
Although I don't know which side's fault this is, I think at least we should add -l option since linux client can still work fine.

comment:11 Changed 5 years ago by ernurse@…

You may already know this, but look here:
http://en.wikipedia.org/wiki/Network_Time_Protocol#Microsoft_Windows

I disable W32Time on my windows boxes and install this instead:
http://www.meinberg.de/english/sw/ntp.htm#ntp_nt_stable

Works fine keeping time sync'd. Must be run as administrator.

comment:12 Changed 4 years ago by nbd

  • Resolution set to fixed
  • Status changed from new to closed

in current versions it is configurable

comment:13 Changed 4 years ago by Paul Marks <paul@…>

This bug was fixed in Busybox git, and should be part of the 1.21 release:

https://bugs.busybox.net/show_bug.cgi?id=5120

comment:14 Changed 2 years ago by jow

  • Milestone changed from Backfire 10.03.2 to Chaos Calmer (trunk)

Milestone Backfire 10.03.2 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.