ntp.drift file not present

Having issues with your DietPi installation, or, found a bug? Post it here.

ntp.drift file not present

Postby Gord_W » Thu Jan 12, 2017 12:25 am

Hi,

Ref. viewtopic.php?f=11&t=233

Using V140 on rpi3

I see that there is no ntp drift file present in /var/lib/ntp and one does not get created there. I don't know if this is a permissions thing. ntp owns the directory, but root is running ntpd.

I tried adding the file to the directory but it is not updating it. I put a drift number into the drift file and on start up it is being read and applied.

Not sure what is going on here.
Gordon Williams
Gord_W
 
Posts: 80
Joined: Sat Oct 24, 2015 4:30 pm

Re: ntp.drift file not present

Postby Fourdee » Thu Jan 12, 2017 4:05 pm

Gord_W wrote:I see that there is no ntp drift file present in /var/lib/ntp and one does not get created there. I don't know if this is a permissions thing. ntp owns the directory, but root is running ntpd.

I tried adding the file to the directory but it is not updating it. I put a drift number into the drift file and on start up it is being read and applied.

Not sure what is going on here.
Gordon Williams

Hi Gordon,

Just looking through notes:
Code: Select all
      #-------------------------------------------------------------------------------
      #NTPD drift file ownership must match user that NTPD runs as, or it wont write to drift file (even though its ran as root.......)
      chown root:root /var/lib/ntp/ntp.drift


Still failing to create/update drift file. I'll look into it:
https://github.com/Fourdee/DietPi/issues/709
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.
User avatar
Fourdee
Site Admin
 
Posts: 2058
Joined: Tue Feb 06, 2007 12:36 pm

Re: ntp.drift file not present

Postby Fourdee » Thu Jan 12, 2017 4:40 pm

Hi Gordon,

In the next update (v142), we will make the move from NTPD to systemd-timesyncd for Daemon + Drift mode. Tested and works a treat:
https://github.com/Fourdee/DietPi/issues/709#issue-200407295
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.
User avatar
Fourdee
Site Admin
 
Posts: 2058
Joined: Tue Feb 06, 2007 12:36 pm

Re: ntp.drift file not present

Postby Gord_W » Thu Jan 12, 2017 7:57 pm

Fourdee wrote:In the next update (v142), we will make the move from NTPD to systemd-timesyncd for Daemon + Drift mode. Tested and works a treat:
https://github.com/Fourdee/DietPi/issue ... -200407295


Hmm, not sure. Your drift is 0 ppm in the above example. Where is the drift file? Any man pages that I have been able to see are short on details. Do you have a good description?

What I'm doing is setting up the clock to run within a few ppm of drift from atomic time over a large temperature range when the rpi is not connected to the internet. It is for a timing application.

The clock calibration procedure is:
1) start ntpd with ntp.conf file modified for local atomic ntp servers.
2) Let run over a period of time like a 1/2 day.
3) Determine the drift using ntptime. This drift number should be written in the drift file every hour but it is not. I add this manually to the drift file.
4) Stop ntpd
5) then to check cal - run ntpdate -q some-server-names to determine the baseline offsets for each of the ntp servers
6) Repeat 5) a few hours later to ensure that the time drift is small and within my expectations.

For use:
1) run ntpd -gq to start, apply drift from drift file, get time if internet available, and stop
2) set time if not done in 1)

Related - ntpdate has been deprecated, but I haven't been able to find a new tool that does the job of ntpdate -q that compares the system clock against ntp servers without making any changes to the system clock. ntpdate doesn't need ntpd running while things like ntpdc dmpeers needs ntpd running which changes the clock and wrecks the offset drift test.

My needs are not typical so don't go changing things around just for me. :)
Gordon Williams
Gord_W
 
Posts: 80
Joined: Sat Oct 24, 2015 4:30 pm


Return to Troubleshooting

Who is online

Users browsing this forum: No registered users and 1 guest