# ntpd not updating ntp.drift file

## rsala

I have been fiddling around with ntp on and off for a while now, but I'm now encountering a problem I haven't seen before.  As part of the default run-level I run ntp-client which gets me sync'd to within about a mS of my server.  Then ntpd runs.  All indications (ps, ntpq and the logs) suggest that ntpd is running OK except the clock's offset gradually drifts ahead of the server.  When I check the driftfile it is always set at 0.000 -- even though

```
ls -l /var/lib/ntp/ntp.drift
```

shows that the file is being modified every hour.

For giggles I manualy set the driftfile to -10.000.  After an hour its timestamp gets updated, but it still reads -10.000.  The following is the output from running

```
ntpq -p
```

For the record, I have followed the gentoo ntp wiki (to the best of my ability) and I am running in a private enclave with only one ntp server available to me.  Due to extreme paranoia I have obscured the name of my time server, but the rest of the output is verbatum.

```

     remote           refid      st t when poll reach   delay   offset  jitter

==============================================================================

 xxxxxxx.xxxx.xx .LOCL.           1 u   46   64  377   36.159  170.503  10.446

```

----------

## whiskas

Just a shot in the dark here, but what servers are you using for synchronization?

What does 

```
ntpq -pn
```

 show? Have you tried using the servers provided by the NTP Server Pool Project?

Please, post more info.

----------

## PaulBredbury

Check that this line is in /etc/ntp.conf

```
driftfile /var/lib/ntp/ntp.drift
```

----------

## rsala

If you check the fine print of my original post you will note that I am running in a private enclave and only have one time server available to me.  I know this is not optimal, but the fact that I am gradually drifting off in one direction suggests that ntp should be generating a frequency correction and that this correction should be captured in the driftfile every hour.

In my case /etc/ntp.conf points to the correct place, and ntp is in fact touching the driftfile every hour but is not changing the frequency.  If I evoke

```
ntptime
```

It shows the frequency to be whatever is set in the driftfile.

----------

## rsala

I found my problem.  Although I can talk to my sole time server, ntp is rejecting it.  I should have caught the fact that there is a space before the server name in the output from `ntpq -p` -- as opposed to an asterik or plus sign.  Running

```
ntpq

ntpq> as
```

verified that ntpd was rejecting this timeserver.  I'm guessing its a broken windows implementation.

----------

