System clock gone bonkers, ubuntu ntpd driving me bonkers

Place to discuss Debian Linux and Debian based distributions
Post Reply
X11
guru
guru
Posts: 676
Joined: Sun Jan 19, 2003 11:09 pm
Location: Australia
Contact:

System clock gone bonkers, ubuntu ntpd driving me bonkers

Post by X11 » Mon Oct 26, 2009 6:02 pm

I have a laptop which has an interesting problem with its hardware. The system clock pauses at times and sometimes goes faster. This means the time can drift and awful lot and under a default configuration ntpd ends up doing nothing to correct the time.

I basically want to configure the system so that NTP corrects the time which is otherwise distorted by a strangely unreliable system clock. I have never had a problem like this before but I have on many occasions used ntpd to set the time on a system with no clock battery or whatnot. On this system the clock isn't unreliable on a reboot, while running, it goes fast or slow.

So I decided to make the following script, that will run every five minutes as a cron job.

Code: Select all

root@ubuntu:~# cat /usr/local/bin/ntp-update 
#!/bin/sh

/etc/init.d/ntp stop
/usr/sbin/ntpd -gx -c /etc/ntp.conf
sleep 1

/etc/init.d/ntp start
(I might add it to rc.local as well)

This script unfortunately does not always seem to work. I think there might be an error in my ntpd.conf below:

Code: Select all

root@ubuntu:~# cat /etc/ntp.conf 
driftfile /var/lib/ntp/ntp.drift

statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable

#These are the addresses for my own NTP servers on my LAN, and the first server on the internet.
server delta.acropolis.local dynamic
server epsilon.acropolis.local dynamic
server lambda.acropolis.local dynamic
server acropolis.johntate.org dynamic

restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery

restrict 127.0.0.1
restrict ::1

Post Reply