LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   NTP Sync? (https://www.linuxquestions.org/questions/linux-networking-3/ntp-sync-434189/)

carlosinfl 04-11-2006 03:08 PM

NTP Sync?
 
Ok - My machine is on a LAN which has their own dedicated NTP server. How can I make my machine sync with our local NTP server? Is their a command? I don't recall but I beleive I have a NTP service running on my Debian machine - I just forgot how to command it to sync. I did google this and came up confused.

Can anyone tell me if I have the correct services configured to sync with a local NTP server and how to do so?

pljvaldez 04-11-2006 03:42 PM

Not at my Debian box, but I think I installed ntp and then edited /etc/ntp.conf to contain a server on my network. Then I just restarted the ntp service. If you only need to have a client, you can use ntpdate and run it once from a cronjob.

http://www.debian.org/doc/manuals/sy...s-syncing-time

Hangdog42 04-11-2006 03:43 PM

I think you want to use ntpd (which I think would be available for Debain if not already installed) and pretty much all you need to do is edit the /etc/ntp.conf file to point to your local NTP server.

carlosinfl 04-11-2006 03:55 PM

How do I know if ntpd is already installed? I don't have anything regarding "NTP" or "ntp" in my /etc directory. I also can't seem to find it via APT :scratch:

Code:

cwilliams:/etc# apt-get install ntpd
Reading package lists... Done
Building dependency tree... Done
E: Couldn't find package ntpd


pljvaldez 04-11-2006 04:04 PM

Try ntp-server.

As for if it's installed, you can try dpkg --get-selections |grep ntp

carlosinfl 04-12-2006 07:51 AM

This is what I found...

Code:

cwilliams@cwilliams:~$ dpkg --get-selections |grep ntp
ntpdate

What would be the command to sync the time as right now my clock says 4:51 & the correct time is 8:51 am.

TigerOC 04-12-2006 08:16 AM

You need to apt-get install ntp-server. The configuation file is /etc/ntp.conf. Edit this file by reming the server lines and add your own;
server <ip_address of your network time server>

carlosinfl 04-12-2006 08:19 AM

So I have to run an NTP server utility on my machine just to sync to an NTP server? I don't want my machine to be an NTP server if that makes sence.

rickh 04-12-2006 08:22 AM

apt-get install ntp-simple

Takes care of everything

carlosinfl 04-12-2006 08:25 AM

OK - I found the package.

Code:

cwilliams:/home/cwilliams# apt-cache search ntp-server
ntp-server - Network Time Protocol: common server tools
cwilliams:/home/cwilliams# apt-get install ntp-server
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
  ntp ntp-simple
Suggested packages:
  ntp-doc
The following NEW packages will be installed
  ntp ntp-server ntp-simple
0 upgraded, 3 newly installed, 0 to remove and 71 not upgraded.

I have edited the ntp.conf file with my local NTP servers and saved the file. Now what? How do I force a sync w/o rebooting.

TigerOC 04-12-2006 08:34 AM

Quote:

Originally Posted by Carlwill
So I have to run an NTP server utility on my machine just to sync to an NTP server? I don't want my machine to be an NTP server if that makes sence.

It doesn't have to be a server in strict terms but could be. A quick explanation will help you understand. The server software starts by getting time from the remote server every 64 seconds. It then calculates the natural error of your own system clock and places this info in the drift file. As the drift becomes more consistent it reduces the number of requests made on the remote server and finally settles on a request rate of 1024 seconds because the software can compensate for the error of the system clock. The problem with an app like ntpdate is that it fires a wholes series of requests at the remote server and admins that run these can get a bit techy about this. I run a server as part of the ntp.pool.org and it really p....ses me off.

TigerOC 04-12-2006 08:36 AM

Quote:

Originally Posted by Carlwill
I have edited the ntp.conf file with my local NTP servers and saved the file. Now what? How do I force a sync w/o rebooting.

do as root from a terminal /etc/init.d/ntp-server start (or stop or restart)

carlosinfl 04-13-2006 10:33 AM

Code:

cwilliams@cwilliams:~$ su
Password:
cwilliams:/home/cwilliams# cd /
cwilliams:/# /etc/init.d/ntp-server start
Starting NTP server: ntpd.

Thanks!

That worked...


All times are GMT -5. The time now is 05:19 AM.