[ntp:questions] NTP shared memory driver

clouddese at gmail.com clouddese at gmail.com
Thu Sep 11 08:57:03 UTC 2014

Hi to all.

I'm trying to setup an NTP server. I have an external device that is connected to a GPS signal and sends to my device the time. My device runs an application that  receives this time and has to fill-in the shared memory of NTP, thus allowing NTP to adjust system time and to distribute the time to other clients connected.

In my device I'm trying to setup NTP in a way in which he can read the time only from the shared memory.

My configuration file il se following:

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

# shared memory configuration
server minpoll 4 maxpoll 4 prefer
fudge time1 0.420 refid SHM1 stratum 0 true

server minpoll 4 maxpoll 4
fudge time1 0.420 refid SHM2 stratum 0 true

NTP is running:
emh2 at tutnix:/var/log$ ps -fea | grep ntp
emh2      9709  3167  0 10:24 pts/0    00:00:00 grep --color=auto ntp
ntp      23280  2013  0 09:59 ?        00:00:00 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 117:126 -c /etc/ntp.conf

and I have shared memory segment:

emh2 at tutnix:/etc$ sudo ipcs -m

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status      
0x4e545030 5406720    root       600        80         1                       
0x4e545031 5439489    root       600        80         1                       

Querying the ntp gives me:

emh2 at tutnix:/etc$ ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
 SHM(0)          .SHM1.           0 l    -   16    0    0.000    0.000   0.000
 SHM(1)          .SHM2.           0 l    -   16    0    0.000    0.000   0.000

Seems that nothing is working.

I've written a simple application for now that writes in the shared memory segment the information about time following the approach shown here:

Can someone please help me?

Thanks in advance,

More information about the questions mailing list