Recently my network connection now is setup AFTER ntpd is launched rather than before. So when ntpd starts there is no net connection and it gives up. I read /usr/src/UPDATING but nothing is mentioned about a change in boot order. Any ideas? Thanks, Dan Allen
On Dec 14, 2010, at 4:38 PM, Dan Allen wrote:> Recently my network connection now is setup AFTER ntpd is launched rather than before. > > So when ntpd starts there is no net connection and it gives up.Change the REQUIRE line in /etc/rc.d/ntpd to indicate whatever dependency you need to have so that your network connection is up before ntpd tries to run. "man rcorder" is informative.... Regards, -- -Chuck
On Tue, Dec 14, 2010 at 05:38:49PM -0700, Dan Allen wrote:> Recently my network connection now is setup AFTER ntpd is launched rather than before. > > So when ntpd starts there is no net connection and it gives up. > > I read /usr/src/UPDATING but nothing is mentioned about a change in boot order. > > Any ideas?This issue has been discussed pretty thoroughly in the past. There's no official solution, but there is an rc.d script I wrote which addresses this shortcoming. Nothing related to the "boot order" has changed, but network drivers and overall methodology has changed. Anyway, many people are using the below with success. http://jdc.parodius.com/freebsd/netwait Official patches, including the rc.conf(5) change I propose: http://jdc.parodius.com/freebsd/netwait_patches/ Example usage (in rc.conf): netwait_enable="yes" netwait_ip="4.2.2.1 4.2.2.2" netwait_if="em0" For what these variables mean, please see the script itself. They are thoroughly documented. -- | Jeremy Chadwick jdc@parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |
On Tue, Dec 14, 2010 at 05:38:49PM -0700, Dan Allen wrote:> Recently my network connection now is setup AFTER ntpd is launched rather than before. > > So when ntpd starts there is no net connection and it gives up.Let me guess: You're on a DHCP network and the network script are running before the network address is assigned. The solution is to wait for DHCP negotiation to complete before letting the rest of the network scripts to complete. I added the following to /etc/rc.conf: ifconfig_re0="SYNCDHCP" Change re0 to your network device. Cheers. -- Jonathan Chen <jonc@chen.org.nz> ---------------------------------------------------------------------- "The things we know best are the things we haven't been taught." - Marquis de Vauvenargues
My high-tech solution to NTPDATE (et.al.) running before the link was up was to edit /etc/rc.d/NETWORKING and append these two lines at the bottom of the file: =====/bin/echo "Waiting 10s for network link to wake up." /bin/sleep 10 ===== This has solved this startup problem in all the cases where it had previously been a problem.
On 14 Dec 2010, at 5:47 PM, Jeremy Chadwick wrote:> Anyway, many people are using the below with success.Sorry to say that netwait did NOT in the end fix the problem. I however discovered that if I put synchronous_dhclient="YES" into my /etc/rc.conf file, that over many days & reboots now has been delivering reliable networking such that ntpd always works. Thanks again to everyone for their help. Dan