LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-01-2010, 12:06 PM   #1
clivethrust
LQ Newbie
 
Registered: Nov 2010
Posts: 6

Rep: Reputation: 0
NTP server


Hi, I am tring to setup Ubuntu (10.04 LTS) as an NTP server for my local network.
I can ping the Machine OK and I can VNC to it with no problem so it is visable on my network

I have run
sudo apt-get install ntp OK

I then tried
sudo /etc/ntpd.conf

The error message
sudo: /etc/ntpd.conf: command not found

what am I doing wrong?
 
Old 11-01-2010, 12:14 PM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,252

Rep: Reputation: 313Reputation: 313Reputation: 313Reputation: 313
Because it is not command. You want to edit it. For example:
Code:
sudo editor /etc/ntpd.conf
 
Old 11-01-2010, 12:19 PM   #3
clivethrust
LQ Newbie
 
Registered: Nov 2010
Posts: 6

Original Poster
Rep: Reputation: 0
I just tried and I got a flashing cursor, but how/where do I check/add external NTP server.
I have also tried setting the IP address as the time server in windows and it fails!
 
Old 11-01-2010, 12:46 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,945

Rep: Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693
Quote:
Originally Posted by clivethrust View Post
I just tried and I got a flashing cursor, but how/where do I check/add external NTP server.
I have also tried setting the IP address as the time server in windows and it fails!
And it will, since you've not configured NTP, nor started the service.

First, you have to set up NTP to use SOMETHING as a reference clock, otherwise it'll fail back to a non-trusted time source, and nothing will be able to use it. See this link http://www.approvedarticles.com/Arti...TP-Server/3591 on how to set up your Linux box to use some public NTP time servers as a reference.

Next, you need to make sure your clock is sync'ed with a time server. If time is off too much, NTP won't start/stay running. As root, run "sntp -P no -r pool.ntp.org", which will sync your clock. Run it several times. When you're done, fire up NTP with "sudo /etc/init.d/ntp start", and it SHOULD fire up.

Check it with "ntptrace". At first, it'll be a stratum 16 (untrusted) reference. Let it run a while, then you should see it go down, probably to a 1 or a 2, depending on your reference source, which will always be one up from what you're referencing. For example, if you're sync'ing to a stratum 2 clock, the best you can ever be is a 3. Also, check it with "ntpq -p", which will show you your server chain.
 
Old 11-01-2010, 02:00 PM   #5
clivethrust
LQ Newbie
 
Registered: Nov 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks for that it is now working - with one minor problem

The time on the server is correct, I set my pc o sync to the server - no problem correct time.

BUT when i sync another piece of equipment the time is out by 4 hours!!!

This would be correct if I was on UK time but why are the times different on an PC and other equipment (Motorola canopy)?

One Idea I had was the keyboard is set to UK because that is the only keyboard I can get the @ symbol to work (ALL others show " - this applies to the @ and " on the keyboard!)
 
Old 11-01-2010, 02:30 PM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,945

Rep: Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693
Quote:
Originally Posted by clivethrust View Post
Thanks for that it is now working - with one minor problem

The time on the server is correct, I set my pc o sync to the server - no problem correct time.

BUT when i sync another piece of equipment the time is out by 4 hours!!!

This would be correct if I was on UK time but why are the times different on an PC and other equipment (Motorola canopy)?

One Idea I had was the keyboard is set to UK because that is the only keyboard I can get the @ symbol to work (ALL others show " - this applies to the @ and " on the keyboard!)
That's got nothing to do with the Linux server, and there's nothing to do from that side of things. The device is set to use the wrong timezone/offset, so you'll have to change it there.
 
Old 11-01-2010, 03:10 PM   #7
clivethrust
LQ Newbie
 
Registered: Nov 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Hi, I have tried to change the timeserver to another one that is local (Toronto).

Here is the error message i get.

administrator@administrator-desktop:~$ server time -u 128.100.56.135
Starting service Echo...
Echo Server - Version 1.0
=========================

General Parameters:
Pool Handle = EchoPool
Reregistration Interval = 30.000s
Local Addresses = { all }
Runtime Limit = off
Policy Settings
Policy Type = RoundRobin
Load Degradation = 0.000%
Load DPF = 0.000%
Weight = 0
Weight DPF = 0.000%
01-Nov-2010 15:05:17.0012: P1642.b78956d0@administrator-desktop rserpoolsocket.c:347 doRegistration()
01-Nov-2010 15:05:17.0015: Error: (Re-)Registration failed: no registrar available
Registration:
Identifier = $b5c791f8

What am I doing wrong?
 
Old 11-01-2010, 05:22 PM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,945

Rep: Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693
Quote:
Originally Posted by clivethrust View Post
Hi, I have tried to change the timeserver to another one that is local (Toronto).

Here is the error message i get.

What am I doing wrong?
No idea, since AGAIN, this isn't Linux related. You need to read up on what time services provide, and how. Time is just ticks of a clock....which is what NTP provides. The time that's DISPLAYED is set by time zones, etc.

Once again, the Motorola device that's off is the piece that has the wrong time zone. Fix it there. Read the manual that came with it.
 
Old 11-02-2010, 08:32 AM   #9
clivethrust
LQ Newbie
 
Registered: Nov 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Since I had never used Linux until yesterday please forgive my lack of knowledge!

but this is where I am getting lost, the only option in thr motorola is the IP address of the time server, in this case 10.0.12.38. I enter that into the equipment and the time updates +4 hours. The linux time clock and local settings on the GUI are correct.
I suspected that the time server I had used in Linux was giving me an incorrect time, when I check it is telling me the time server is europium.canoni 193.79.237.14 2 u 818 1024 377 106.027 -0.859 2.804, so I tried to change this and I get the error message:

administrator@administrator-desktop:~$ server time -u 128.100.56.135
Starting service Echo...
Echo Server - Version 1.0
=========================

General Parameters:
Pool Handle = EchoPool
Reregistration Interval = 30.000s
Local Addresses = { all }
Runtime Limit = off
Policy Settings
Policy Type = RoundRobin
Load Degradation = 0.000%
Load DPF = 0.000%
Weight = 0
Weight DPF = 0.000%
01-Nov-2010 15:05:17.0012: P1642.b78956d0@administrator-desktop rserpoolsocket.c:347 doRegistration()
01-Nov-2010 15:05:17.0015: Error: (Re-)Registration failed: no registrar available
Registration:
Identifier = $b5c791f8

I have made sure the ntp is running using #service ntpd start.
I have tried sudo editor /etc/ntpd.conf
This is what appears on screen

GNU nano 2.2.2 File: /etc/ntpd.conf


[ New File ]
^G Get Help ^O WriteOut ^R Read File ^Y Prev Page ^K Cut Text ^C Cur Pos
^X Exit ^J Justify ^W Where Is ^V Next Page ^U UnCut Text^T To Spell

I know I am doing somthing wrong but I cant see the wood for the trees!
 
Old 11-02-2010, 11:08 AM   #10
cojo
Member
 
Registered: Feb 2003
Location: St. Louis
Distribution: RedHat 8
Posts: 262

Rep: Reputation: 31
the file name is ntp.conf not ntpd.conf.
 
Old 11-02-2010, 11:22 AM   #11
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,945

Rep: Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693
Quote:
Originally Posted by clivethrust View Post
Since I had never used Linux until yesterday please forgive my lack of knowledge!

but this is where I am getting lost, the only option in thr motorola is the IP address of the time server, in this case 10.0.12.38. I enter that into the equipment and the time updates +4 hours. The linux time clock and local settings on the GUI are correct.
I suspected that the time server I had used in Linux was giving me an incorrect time, when I check it is telling me the time server is europium.canoni 193.79.237.14 2 u 818 1024 377 106.027 -0.859 2.804, so I tried to change this and I get the error message:

I know I am doing somthing wrong but I cant see the wood for the trees!
Pay close attention: THIS HAS NOTHING TO DO WITH THE LINUX TIME SERVER, as I've said before. Lack of knowledge in Linux isn't the issue here.

Step one: set up your Linux time server. You've done this, as the output tells us, you've got a stratum 2 clock.
Step two: point your devices to it. Point your Motorola device to your local Linux box (if that's the address you put in above).

That's it. Nothing is left to do. If the Motorola Canopy is displaying the incorrect time, then THE PROBLEM IS ON THE MOTOROLA DEVICE. The time zone/offset on IT is wrong...fix it.

Again, the clock is up and working fine, and you need to read up on what NTP provides. It does NOT PROIVDE LOCAL TIME..only a reference to the time source. The local systems interpret it, and display a 'human readable' time from there. The fact that your Linux system displays the correct time says that.
 
Old 11-02-2010, 11:42 AM   #12
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,948

Rep: Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530
NTP is based on UTC (i.e. GMT) and so does not matter what server is actually polled. Obviously timing is better with a server that is nearest. The computer/device uses the timezone information to set its clock to local time. Without looking at the ntp.conf file it is difficult to tell if your PC is configured to serve time to other devices on your network.

It might help to know the name and model number of this Motorola device. Is it another computer and is it capable of syncing time with a NTP server?


Edit:
Missed that it was a Canopy device.

Last edited by michaelk; 11-02-2010 at 11:49 AM.
 
Old 11-02-2010, 12:31 PM   #13
clivethrust
LQ Newbie
 
Registered: Nov 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks for the replies:

I have checked the Motorola canopy equipment and the only option is "NTP Server IP Address" there are NO timezones - when I enter the IP address the time is +4 hours (GMT).
Using ntpq -p the result is "europium.canoni 193.79.237.14" I want to edit that and change it to a local server but I have been unable to.

I used ntp.conf but there is no reference to this address, I tried ntpd.conf and an empty dialogue box opens?

The local time on the server is correct, so all I want to do is just try to add another local NTP time source to see if this is will help. I have sent an email to Motorola to see if there is a way to change from GMT but no reply yet.

It may well be the Motorola equipment theat is the problem here, but I have NO way to change this for now.
 
Old 11-02-2010, 12:44 PM   #14
cojo
Member
 
Registered: Feb 2003
Location: St. Louis
Distribution: RedHat 8
Posts: 262

Rep: Reputation: 31
clivethrust,

ntpd.conf doesn't exist on /etc so when you vi /etc/ntpd.conf you creating a new file that's why you get an empty dialogue box.

First the timezone is base on your clock setting so you need to change your timezone on your system. So, you need to vi /etc/ntp.conf and insert

server 0.pool.ntp.org
server 193,79.237.14

or any server IP you want in the file.

After finish with the ntp.conf file, run this command

ntpdate -u 193.79.237.14
 
Old 11-02-2010, 12:53 PM   #15
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,945

Rep: Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693
Quote:
Originally Posted by cojo View Post
clivethrust,

ntpd.conf doesn't exist on /etc so when you vi /etc/ntpd.conf you creating a new file that's why you get an empty dialogue box.

First the timezone is base on your clock setting so you need to change your timezone on your system. So, you need to vi /etc/ntp.conf and insert

server 0.pool.ntp.org
server 193,79.237.14

or any server IP you want in the file.

After finish with the ntp.conf file, run this command

ntpdate -u 193.79.237.14
He's already getting the server up, the problem is that his router isn't configured correctly to use it. Also, the ntpdate command is depreciated on most current distros, and has been replaced with the sntp command.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems setting up a NTP Server on Ubuntu Server 9.04 mikesmith20001 Linux - Server 1 08-10-2009 11:14 AM
ntp drift file in /etc/ntp instead of /var/lib/ntp - suggestion for a patch in Slack niels.horn Slackware 16 05-07-2009 08:35 PM
dhcp server and ntp server help required (Debian) Raffles666 Linux - Networking 4 04-27-2009 09:00 AM
Suse server not responding after syncing with NTP Server vipin123 SUSE / openSUSE 2 09-04-2008 04:56 PM
NTP cannot use server, NTP -d can jerryvapps Linux - Newbie 0 07-28-2004 03:22 PM


All times are GMT -5. The time now is 08:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration