sorry, ich hab mist erzählt. der ntpd lädt das driftfile nur, wenn der RTC offset 0 ist. änder mal die folgende funktion in ntpd.c
poste bitte mal die zusätzlichen logs (startlog).
edit: code korrigiert
Code:
void
readfreq(void)
{
FILE *fp;
int64_t current;
double d;
if (strlen(DRIFTFILE)==0) /* disabled? */
return;
fp = fopen(DRIFTFILE, "r");
if (fp == NULL) {
/* if the drift file has been deleted by the user, reset */
log_warnx("no driftfile available");
current = 0;
if (adjfreq(¤t, NULL) == -1)
log_warn("adjfreq reset failed");
return;
}
/* if we're adjusting frequency already, don't override */
if (adjfreq(NULL, ¤t) == -1)
log_warn("adjfreq failed");
else /*if (current == 0)*/ {
double cur = current / 1e9 / (1LL << 32);
log_warnx("current RTC freq offset: %fppm",cur*1e6);
if (fscanf(fp, "%le", &d) == 1)
ntpd_adjfreq(d-cur, 0);
else
log_warnx("can't read %s", DRIFTFILE);
}
fclose(fp);
}
edit: code korrigiert
Zuletzt bearbeitet: