Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Jun 1995 09:35:05 -0500 (CDT)
From:      Mike Pritchard <mpp@legarto.minn.net>
To:        hackers@freebsd.org
Subject:   ntpdate
Message-ID:  <199506101435.JAA15758@mpp.com>

next in thread | raw e-mail | index | archive | help
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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199506101435.JAA15758>