[ntp:questions] Re: sntp hangs if network not available

Anil Gunturu anil_gunturu at yahoo.com
Fri Dec 2 01:27:08 UTC 2005

I don't disagree with Harlan about stepping back and understanding what needs to happen. But there is a real issue with sntp, atleast on some systems, waiting forever. It happens because the setjmp is not saving the signal masks - at leat on linux. This is the behavior if the sntp server never responds:
>in read_socket
>setting up alarm for 3 secs
>Before recvfrom
>in jump_handler
>Time out occurred
>in read_socket
>setting up alarm for 3 secs
>Before recvfrom
--------------WAITs forever
  Linux documentaion for setjmp recommends the use of sigsetjmp, and patch I mailed in the previous mail addresses this. BTW, internet.c also suffer from same issue.
Harlan Stenn <stenn at ntp.isc.org> wrote:
  I think you may benefit from taking a step back and understanding exactly
what you want to have happen during startup.

If all goes well, sntp will bet a response "quickly".

If not, how long do you want to wait for an answer?

What do you want to do if an answer does not arrive?

It may be that you want to avoid using sntp (or ntpdate) entirely, and start
ntpd -g as early as possible, using iburst and a usefully persistent drift
file. You might also be interested in:


Anyway, consider starting ntpd "early" and then continue with your startup
and then check to see how well things are going using, for example, the
ntp-wait script to make sure things are OK before "going live".


questions mailing list
questions at lists.ntp.isc.org

 Yahoo! Personals
 Skip the bars and set-ups and start using Yahoo! Personals for free

More information about the questions mailing list