Rork.nl - Articles
Fixed: NTPDate can't find server on boot.
My laptop is rather old and has one problem: the battery of the memory isn't attached well to the motherboard which causes the time to reset to 1-1-2001 12:00 when I turn on my computer. It's quite easy to reset the time with ntp, and since I run Debian/Linux I use ntpdate for it.
It works fine if I run the command in a shell, but the standard script which is run on boot didn't work well and gave an error: "Running ntpdate to synchronize clockError : Temporary failure in name resolution". It couldn't find the ntpserver because it couldn't connect to the network. This was to be expected because although the network was loaded, pcmcia (the slot my networkcard uses) wasn't. So my first idea was to run it later at boot, just before starting kdm.
This didn't work out as well as I expected, still the same error. After reading some on the topic I found the reason and a solution. My networkcard/pcmcia uses firmware or something else that needs a few seconds to load to work propperly. The ntpdate script is called within these seconds so it can't find the network.A better solution might be to run a script after the network comes up. This can be done by placing a script which runs ntpdate in /etc/network/if-up.d/
This seems to work pretty well, most of the time the time is correct but sometimes I have to run ntpdate manually and I still get the error when booting.
Sample script:
#!/bin/sh ntpdate ntp.pool.org