From owner-freebsd-hackers Sat Jun 10 07:35:18 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id HAA14341 for hackers-outgoing; Sat, 10 Jun 1995 07:35:18 -0700 Received: from mpp.com ([204.157.201.242]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id HAA14328 for ; Sat, 10 Jun 1995 07:35:09 -0700 Received: (from mpp@localhost) by mpp.com (8.6.11/8.6.9) id JAA15758 for hackers@freebsd.org; Sat, 10 Jun 1995 09:35:05 -0500 From: Mike Pritchard Message-Id: <199506101435.JAA15758@mpp.com> Subject: ntpdate To: hackers@freebsd.org Date: Sat, 10 Jun 1995 09:35:05 -0500 (CDT) X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1767 Sender: hackers-owner@freebsd.org Precedence: bulk I'm using pppd to establish an outgoing PPP connection, and in my /etc/ppp/ip-up script I'm running ntpdate to adjust the time (my clock usually gains quite a bit of time each day, so I like to try and run ntpdate everytime I connect up). The problem is that when ntpdate is run within my /etc/ppp/ip-up script, it just hangs. Running ntpdate from a shell prompt right away after pppd reports that the connection is ready works just fine. I recompiled ntpdate with -g, and attached a hung ntpdate with gdb. This reveals that it is hanging up in a select() call at line 353 of ntpdate.c. Running ntpdate with the "-d" option doesn't provide any hints, either. It just prints a one line version message before hanging up in select. I know that the link is usable at the time I call ntpdate, since the next two lines in the ip-up script are a "sendmmail -q" command to process any outgoing mail, and a popclient command to fetch my mail from my ISP, and those work just fine. Is the link not-quite-ready yet at the time pppd runs the ip-up script? If so, then that seems like a bug, since the man page even says that this script can be used to run things like sendmail. I'm willing to rip into ntpdate and figure out what is going on, but I thought I would try to save myself some time and ask here first, in case I'm doing something really dumb that I'm overlooking. Here is my ip-up script: #!/bin/sh INTERFACE=$1 ifconfig $INTERFACE up logger -p local0.info -t PPP PPP connection ready # # Fetch any incoming mail for us and tell sendmail to send any # queued up outgoing mail. # sleep 4 ntpdate tock.usno.navy.mil popclient ... sendmail -q -- Mike Pritchard mpp@legarto.minn.net "Go that way. Really fast. If something gets in your way, turn"