LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   NTPD exits after time reset (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/ntpd-exits-after-time-reset-928647/)

PrayingMantis 02-10-2012 07:30 AM

NTPD exits after time reset
 
Hi,

I use ntpdate before starting ntpd on my board, however, as soon as the time is synchronized with the NTP server, ntpd exits silently with no messages in the logs :
Code:

root@myServer:/# cat /var/log/messages | grep ntp
Feb 10 13:10:16 NOTICE  ntpdate[974]: step time server 192.168.29.211 offset 5.610707 sec
Feb 10 13:10:17 NOTICE  ntpd[985]: ntpd 4.2.4p0@1.1472-o Thu Jan  6 11:12:03 UTC 2011 (1)
Feb 10 13:10:17 INFO    /etc/init.d/ntpd: ntpd startup - OK
Feb 10 13:10:17 INFO    ntpd[986]: precision = 10.895 usec
Feb 10 13:10:17 INFO    ntpd[986]: Listening on interface #0 wildcard, 0.0.0.0#123 Disabled
Feb 10 13:10:17 INFO    ntpd[986]: Listening on interface #1 lo, 127.0.0.1#123 Enabled
Feb 10 13:10:17 INFO    ntpd[986]: Listening on interface #2 eth0, 192.168.29.200#123 Enabled
Feb 10 13:10:17 INFO    ntpd[986]: kernel time sync status 0040
Feb 10 13:12:15 INFO    watchdog[1292]: pidfile: /var/run/ntpd.pid
Feb 10 13:13:32 INFO    ntpd[986]: synchronized to 192.168.29.211, stratum 11
Feb 10 13:13:32 NOTICE  ntpd[986]: kernel time sync enabled 0001
Feb 10 13:28:39 NOTICE  ntpd[986]: time reset +0.215637 s
Feb 10 13:28:45 ERROR  watchdog[1292]: pinging process 986 (/var/run/ntpd.pid) gave errno = 3 = 'No such process'
Feb 10 13:28:45 INFO    watchdog: Watchdog restarted ntpd
Feb 10 13:28:45 ERROR  /etc/init.d/ntpd: ntpd shutdown - FAILED
Feb 10 13:28:46 NOTICE  ntpd[1624]: ntpd 4.2.4p0@1.1472-o Thu Jan  6 11:12:03 UTC 2011 (1)
Feb 10 13:28:46 INFO    ntpd[1625]: precision = 10.895 usec
Feb 10 13:28:46 INFO    ntpd[1625]: Listening on interface #0 wildcard, 0.0.0.0#123 Disabled
Feb 10 13:28:46 INFO    ntpd[1625]: Listening on interface #1 lo, 127.0.0.1#123 Enabled
Feb 10 13:28:46 INFO    ntpd[1625]: Listening on interface #2 eth0, 192.168.29.200#123 Enabled
Feb 10 13:28:46 INFO    ntpd[1625]: kernel time sync status 0040
Feb 10 13:28:46 INFO    /etc/init.d/ntpd: ntpd startup - OK
Feb 10 13:32:01 INFO    ntpd[1625]: synchronized to 192.168.29.211, stratum 11
Feb 10 13:32:01 NOTICE  ntpd[1625]: kernel time sync enabled 0001

Every time I observe a "time reset" message in the log, the ntpd process gets killed somehow however the PID file still exits. I don't have any idea why is this happening. Here are the contents of my ntp.conf file :
Code:

driftfile /var/lib/ntp/drift
restrict 0.0.0.0 mask 0.0.0.0 noserve
server 192.168.29.211 prefer
restrict 192.168.29.211 mask 255.255.255.255 nomodify notrap noquery

I use the following command to start ntpd on my board:
Code:

ntpd -u ntp:ntp -p /var/run/ntpd.pid -g
The debug info shows the following:
Code:

ntpq> as

ind assID status  conf reach auth condition  last_event cnt
===========================================================
  1 51965  9014  yes  yes  none    reject  reachable  1

ntpq> rv 51965
assID=51965 status=9014 reach, conf, 1 event, event_reach,
srcadr=192.168.29.211, srcport=123, dstadr=192.168.29.200, dstport=123,
leap=00, stratum=11, precision=-20, rootdelay=0.000,
rootdispersion=11.093, refid=LOCAL(0), reach=007, unreach=0, hmode=3,
pmode=4, hpoll=6, ppoll=6, flash=400 peer_dist, keyid=0, ttl=0,
offset=-0.314, delay=1.119, dispersion=1937.996, jitter=0.356,
reftime=d2e4ad11.612a2f53  Tue, Feb 14 2012 15:21:13.379,
org=d2e4ad1d.5fd4fdf0  Tue, Feb 14 2012 15:21:25.374,
rec=d2e4ad1d.600e34aa  Tue, Feb 14 2012 15:21:25.375,
xmt=d2e4ad1d.5fc24ffd  Tue, Feb 14 2012 15:21:25.374,
filtdelay=    1.12    0.47    0.47    0.00    0.00    0.00    0.00    0.00,
filtoffset=  -0.31    0.03    0.05    0.00    0.00    0.00    0.00    0.00,
filtdisp=      0.02    0.98    1.95 16000.0 16000.0 16000.0 16000.0 16000.0

ntpdc> dmpeers

    remote          local          st  poll  reach  delay    offset    disp
===================================================================================
*192.168.29.211  192.168.29.200    11  64    377  0.00047  0.003895  0.04347

ntpdc> loopinfo
offset:              0.003637 s
frequency:        3.334 ppm
poll adjust:        18
watchdog timer: 27 s

ntpdc> monlist
remote address    port    local address      count    m  ver  code  avgint  lstint
===============================================================================
localhost          32782    127.0.0.1        5          7    2    2      54      0
192.168.29.211      123      192.168.29.200    10        4    4    1c0    64      46

ntpdc> pstats 192.168.29.211
remote host:          192.168.29.211
local interface:      192.168.29.200
time last received:  19s
time until next send: 47s
reachability change:  661s
packets sent:        11
packets received:    11
bad authentication:  0
bogus origin:        0
duplicate:            0
bad dispersion:      0
bad reference time:  0
candidate order:      6
flags:  system_peer, config, bclient, prefer

ntptime
ntp_gettime() returns code 0 (OK)
  time d2e4afb8.f3def000  Tue, Feb 14 2012 15:32:32.952, (.952621),
  maximum error 65225 us, estimated error 1218 us
ntp_adjtime() returns code 0 (OK)
  modes 0x0 (),
  offset 2877.000 us, frequency 3.359 ppm, interval 1 s,
  maximum error 65225 us, estimated error 1218 us,
  status 0x1 (PLL),
  time constant 6, precision 1.000 us, tolerance 512 ppm,

ntpstat
synchronised to NTP server (192.168.29.211) at stratum 12
  time correct to within 18 ms
  polling server every 64 s

Any suggestions?

Thanks
Mantis

wpeckham 02-12-2012 12:37 PM

Just the facts please....
 
Hi. I am not sure I can help, but I do see a LOT of information you have not provided.
What distribution are we talking about?
How did you install ntpd? (I see the NTPD version in the log.)
Why are you not using the startup script for ntpd provided in your distribution package? (assuming several things here)
Are you very sure it is exiting? What have you checked?
What have you tried that did not work, and what behavior did you observe?


All times are GMT -5. The time now is 03:06 AM.