How I can update time from my own NTP-server?

Kernels & Hardware, configuring network, installing services

How I can update time from my own NTP-server?

Postby new_user_ » 2008-10-01 13:13

I created my own NTP - server with support GPS-time on gps0 -> /dev/ttyS0 ,
but I can'not update clock own NTP-server through ntpdate from this server. :cry: :cry:

My ntp.conf :
Code: Select all

driftfile /var/lib/ntp.ntp.drift
statsdir /var/log/ntpstats/

restrict 127.0.0.1

restrict 192.168.0.0 mask 255.255.255.0 notrust nomodify notrap

server 127.127.20.0
fudge 127.127.20.0 stratum 1
fudge 127.127.20.0 refid gps0
fudge 127.127.20.0 flag2 1
fudge 127.127.20.0 time1 0.020



NTP error:

Code: Select all
>ntpdate 127.0.0.1
1 Jan 06:21:45 ntpdate[13181]: the NTP socket is in use, exiting


How can I make it?????? :?:
new_user_
 
Posts: 4
Joined: 2008-10-01 12:01

Postby shoof » 2008-10-01 14:12

ntpdate will not run on the same computer that is running the ntp daemon, they both use the same port.
shoof
 
Posts: 379
Joined: 2006-09-08 20:41
Location: My chair

Postby new_user_ » 2008-10-01 14:20

shoof wrote:ntpdate will not run on the same computer that is running the ntp daemon, they both use the same port.


I untestand it. :? But as then to renew clocks on the NTP- server? :(
new_user_
 
Posts: 4
Joined: 2008-10-01 12:01

Postby BowCatShot » 2008-10-01 16:10

After getting thoroughly fed up with ntpdate, having it work sometimes and mostly not, I wrote the following script to scrub the time off of a government time web page, http://www.time.gov/timezone.cgi?Eastern/d/-5

I run it on my Knoppix system. Modify it for your purposes and time zone.

#!/bin/bash
cd /home/knoppix/tmp
wget -qc http://www.time.gov/timezone.cgi?Eastern/d/-5 -O time.html
linewiththetime=`grep "[0-9][0-9]:[0-9][0-9]:[0-9][0-9]<br>$" time.html`
everythingbeforetime=${linewiththetime%%[0-9][0-9]:[0-9][0-9]:[0-9][0-9]*}
everythingaftertime=${linewiththetime##*[0-9][0-9]:[0-9][0-9]:[0-9][0-9]}
almosttime=${linewiththetime#$everythingbeforetime}
thetime=${almosttime%$everythingaftertime}
sudo date -s $thetime
sudo hwclock --systohc
date > /home/knoppix/Desktop/date.log
rm -f /home/knoppix/tmp/time.html
BowCatShot
 
Posts: 845
Joined: 2006-07-15 12:08

Postby new_user_ » 2008-10-01 16:19

Its own NTP-server c GPS exactly is necessary when there is no connection to Internet. So that script from the remote server this unfortunately not solution of problem.
new_user_
 
Posts: 4
Joined: 2008-10-01 12:01

Postby BowCatShot » 2008-10-02 18:56

Could you describe your configuration more clearly? I thought you had one machine on your lan which you wanted to be a time server for the other machines on your lan. I thought you were saying that machine couldn't be both an NTP server and client at the same time and thus you needed a different method for your server to obtain the correct time. I guess I don't understand the problem that you're describing.
BowCatShot
 
Posts: 845
Joined: 2006-07-15 12:08

Postby qmp » 2008-10-02 20:37

try commenting the restricted 127.xxx from your ntp.conf and restarting the ntpd
qmp
 
Posts: 5
Joined: 2008-10-02 20:13


Return to System configuration

Who is online

Users browsing this forum: No registered users and 15 guests

fashionable