ntpd hangs under FBSD 8

Peter Steele psteele at maxiscale.com
Thu Feb 25 22:26:27 UTC 2010


> We'll likely go with this solution instead of downgrading Python and the related libraries.

In fact I came up with another solution. I realized that since the problem was related to the process signal mask, instead of called ntpd directly, wrap it up in a C app that resets the signal mask to something that works. I have the following code:

	   sigset_t set, oset;
	   sigemptyset(&set);
	   pthread_sigmask(SIG_SETMASK, &set, &oset);
	   system("/usr/sbin/ntpd -g -q");
	   pthread_sigmask(SIG_SETMASK, &oset, NULL);

I wrapped this up into a standalone app and call this from Python instead of calling ntpd directly. This solved the problem--no more hang. Thanks very much to Kostik Belousov for his "wild guess" that this was related to the process signal mask. His guess was dead on.



More information about the freebsd-hackers mailing list