OpenWrt Forum Archive

Topic: /etc/hotplug.d/iface/20-ntpclient problem (probably my undestanding of

The content of this topic has been archived on 29 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi All

OK I'm using Kam 7.09 on a wrt54g in a specific configuration and setup, this I think is then causing a problem with 20-ntpclient starting up.

I've had a look at the script in /etc/hotplug.d/iface/20-ntpclient and (I'm not a bash expert so I'm trying to work it out) what's happening is that the script checks to see if the wan interface is up and connected and then (and only then) it runs ntpclient against the settings entered.

However my setup is unusual in that my wan interface is my wifi connection (I don't use the physical WAN connection on the router at all) and my ntp server is on my internal LAN.

So I think if I've understood what's happening correctly is that during the reboot either because the WAN connection (physical) is not used or because the wifi connection is setup as the WAN connection and it's taking a while to come up (during which time 20-ntpclient says the iface is not up so I'm bombing out) ntpclient doesn't start.  Either way I'm stuck.

If anyone could give me some advice as to how to change the 20-ntpclient script or an idea for how to work around the problem I'd be grateful.....at the moment I'm feeling very dumb!!

TIA

this seems to be the relevant section from my build

ps | grep 'bin/[n]tpclient' >&- || {
                                route -n 2>&- | grep '^0.0.0.0' >&- && {
                                        /usr/sbin/ntpclient -c ${count:-1} -s -h $hostname -p ${port:-123} 2>&- >&- && DONE=1
                                }
                        }


I don't see any connection to WAN, more it is looking for a default route and if that exists it then makes the call

is there anything in logread relating to ntpclient ?

The discussion might have continued from here.