On Monday 07 November 2005 01:31, Carlos E. R. wrote:
The Sunday 2005-11-06 at 22:09 +0100, Bjørge Solli wrote:
logfile /var/log/ntp # alternate log file
6 Nov 15:17:23 ntpd[1013]: sendto(129.177.13.13): Bad file descriptor 6 Nov 15:18:26 ntpd[1013]: kernel time sync enabled 0001 6 Nov 15:18:26 ntpd[1013]: sendto(129.177.13.13): Bad file descriptor 6 Nov 15:19:31 ntpd[1013]: sendto(129.177.13.13): Bad file descriptor
Weird! I did not expect that. I had a look at the source code, but I get no clue what it can _really_ mean. And the documentations does not mention that error, I grepped for it.
if (err == EBADF) { int j, b; fds = activefds; for (j = 0; j <= maxactivefd; j++) if ( (FD_ISSET(j, &fds) && (read(j, &b, 0) == -1)) ) netsyslog(LOG_ERR, "Bad file descriptor %d", j); }
and "j" is missing from your log output.
So is "sendto", which is a clue that you're looking at the wrong section of code. The correct section prints the error message at line 1537 of ntpd/ntp_io.c The file descriptor that is bad is the connection to the remote time server. Why it's bad is another question. The code in question doesn't seem to be checking many return values, so the fd could be bad in a number of places, including, as far as I can see, not being opened in the first place (too many open files, perhaps?!) There are also too many #if sections to wade through to be able to follow the code easily, but since it's a transient error, my guess would be something like too many open files or something similar