[ntp:questions] NTP shared memory driver

Claudio Persico clouddese at gmail.com
Fri Sep 12 13:21:21 UTC 2014


> See flag4 in driver28.html, and then collect and look at the clockstats
> 
> in the statsdir.
> 

Ok there are my progresses:

I've updated my ntp.conf file following the suggestion that you gave me:

#
enable stats
statistics clockstats peerstats loopstats rawstats sysstats
statsdir /var/log/ntpstats/
filegen clockstats file clockstats type pid enable
filegen peerstats file peerstats type pid enable
filegen loopstats file loopstats type pid enable
filegen rawstats file rawstats type pid enable
filegen sysstats file sysstats type pid enable


driftfile /var/log/ntp.drift    # path for drift file
logfile /var/log/ntp.log        # alternate log file

# shared memory configuration
server 127.127.28.0 minpoll 4 maxpoll 4 prefer
fudge 127.127.28.0 time1 0.420 refid SHM1 stratum 2 flag4 1

server 127.127.28.1 minpoll 4 maxpoll 4
fudge 127.127.28.1 time1 0.420 refid SHM2 stratum 2 flag4 1


Now I've setup my application to continuosly write the time in the shared memory segment and seems that NTP is using this segment because now I see the star * symbol executing ntpq -p:

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*SHM(0)          .SHM1.           2 l    8   16  377    0.000  420.000   0.004
 SHM(1)          .SHM2.           2 l    -   16    0    0.000    0.000   0.000

I've set-up my application to write in the shared memory a very old time (15th of May) just to see if the system time will be canged, but nothing happened.

I'm also trying to use a ntp client, but the time that is delivered is still the system time without any modification from NTP.

My clockstats file is this one:

[....]
56912 47289.546 127.127.28.0  16   0  16   0   0
56912 47290.547 127.127.28.1  16   0  16   0   0
56912 47305.966 127.127.28.0  16   6  10   0   0
56912 47306.965 127.127.28.1  16   0  16   0   0
56912 47321.966 127.127.28.0  16   8   8   0   0
56912 47322.966 127.127.28.1  16   0  16   0   0
56912 47337.966 127.127.28.0  16   8   8   0   0
56912 47338.965 127.127.28.1  16   0  16   0   0

the peerstats file is:
56912 47305.545 127.127.28.0 9034 0.420000000 0.000000000 7.937501907 0.000003815
56912 47321.966 127.127.28.0 9054 0.420000000 0.000000000 7.937501907 0.000003815
56912 47337.966 127.127.28.0 966a 0.420000000 0.000000000 3.937562861 0.000003815

and the sysstats is:

56912 47049.546 1 0 0 0 0 0 0 0 0 0 0


Do you have any idea of why the system time is not updated?

Thanks a lot in advance,
Claudio



More information about the questions mailing list