Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

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

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
new_user_
Posts: 4
Joined: 2008-10-01 12:01

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

#1 Post by new_user_ »

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?????? :?:

shoof
Posts: 379
Joined: 2006-09-08 20:41
Location: My chair

#2 Post by shoof »

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

new_user_
Posts: 4
Joined: 2008-10-01 12:01

#3 Post by new_user_ »

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? :(

BowCatShot
Posts: 959
Joined: 2006-07-15 12:08

#4 Post by BowCatShot »

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

new_user_
Posts: 4
Joined: 2008-10-01 12:01

#5 Post by new_user_ »

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.

BowCatShot
Posts: 959
Joined: 2006-07-15 12:08

#6 Post by BowCatShot »

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.

qmp
Posts: 5
Joined: 2008-10-02 20:13

#7 Post by qmp »

try commenting the restricted 127.xxx from your ntp.conf and restarting the ntpd

Post Reply