Re: Can I synchronise local time with some NTP-server?

2003-06-06 Thread Tom Limoncelli
[ I'm CC:'ing [EMAIL PROTECTED] so that he can add this as a How to 
get started document to the web site. ]

On Wednesday, June 4, 2003, at 03:37  PM, Constantine wrote:

Hello!

I am running FreeBSD 4.8. How can I synchronise my clock with some NTP 
server? The time on my server right now is 4 minutes fast, and I do 
not like that... Can I set up a script that would automatically 
synchronise the time with some available server?

My server is located in the USA, in case one would like to suggest 
some good servers to synchronise with. :-)
I don't think that read the man page is a very good answer.  The man 
page doesn't explain things very well (if someone would like to submit 
what I write below to the maintainer, please do so).

Step 0:  Is it ntp or xntp?

Some operating systems supply binaries with the x and sometimes 
without the x.  This document uses options that should work for 
either.  I'll always specify the command without the x.  If you 
receive a command not found, try it with an x.

Step 1: Pick your servers

Find some public servers that you can sync with.  Two is good enough.  
There is a complete list here: http://www.ntp.org (it's a link to 
http://www.eecis.udel.edu/~mills/ntp/servers.html;)

These sites are kind enough to perform this service for you, you should 
follow any guidelines they request (asking permission first, donations, 
thank-you notes, whatever.)

Let's suppose you've picked clock.example.org and 
timekeeper.sample.com.  Those aren't real sites, but I'll use them as 
examples in the rest of this document.

Step 2:  Manually set the clock correctly just once

Let's manually set the clock to the correct time just to start things 
off.  When ntpd is running and finds your clock is wrong, it makes tiny 
little changes until the clock is right.  This way applications don't 
get confused.  However, on reboot, the clock may have lost a lot of 
time and since no applications are running yet, we can make a big 
timeleap to correct the clock.  To do this, we use a different utility 
called ntpdate.  It can't run at the same time as ntpd.  We even give 
it the -b option so that it knows to leap forward or backwards in 
time to set the clock correctly.

Here's the command that does this:

ntpdate -b clock.example.org timekeeper.sample.com
(NOTE: Substitute the 2 NTP servers that you'd like to sync with.)
Try this once from the command line (as root) to make sure you're got 
it right.

# ntpdate -b clock.example.org timekeeper.sample.com
 5 Jun 08:50:18 ntpdate[23777]: step time server SOME_IP_ADDRESS offset 
-111.106949 sec

This means that your clock was off by -111.106949 seconds, but now it's 
been brought up to date.  The good news is that for an instant you were 
in sync.  The bad news is that by the time you read this, your clock 
has drifted. Darn computers!

Step 2:  Set the clock correctly on every boot up

On reboot, you want to tell the system to sync up quickly.  While your 
machine was down the CPU gets bored and plays with the clock.  Haven't 
you ever been in a clock store waiting for your mother to make her 
purchase and started setting the clocks to funny times?  It's like 
that, only your mother has nothing to do with this (I'm sure she's a 
very nice person, you just don't appreciate her enough).

Let's configure your system to run this command on boot up.  Here's how 
to do this on various operating systems:

FreeBSD:
Simply add this line to the end of /etc/rc.conf:
ntpdate_enable=YES
ntpdate_flags=-b clock.example.org timekeeper.sample.com
Solaris 9:
This is done automatically if a properly configured 
/etc/inet/ntp.conf exists.

(people can volunteer the easiest way to do this on their favorite OS)

Step 3: Keep the clock in sync permanently and continuously.

Having your clock set properly every time you boot is nice, if you 
reboot constantly.  Of course, you could put that command in cron but 
we have a solution that is so much better you'll thank me in the 
morning.  We'll run ntpd which will constantly keep your clock 
correct by making micro-adjustments all day long.  Heck, ntpd is so 
smart that if you lose contact with all your NTP servers it will 
remember how bad your clock was and keep making adjustments based on 
past bad performance.  Pretty cool, eh?

The NTP documentation has volumes about the various features and entire 
books can be written about the theory of operation of NTP.  It's really 
quite amazing how the system works so precisely, so accurately, does 
the right thing through outages, detects and avoids misconfigured 
servers, conserves bandwidth, and fixes problems that you don't yet 
realize you have.  However, you don't care about that, you just want a 
simple configuration that works.  Here's one:

Create a configuration file.  Different systems call it different 
things.
FreeBSD 4.x:  /etc/ntp.conf
Solaris 9: /etc/inet/ntp.conf

Put these 3 lines in your configuration file:

driftfile /etc/ntp.drift
server 

Re: Can I synchronise local time with some NTP-server?

2003-06-06 Thread Tom Limoncelli
An HTML-formatted version can be found here: 
http://whatexit.org/tal/mywritings/starting-ntp.html

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Can I synchronise local time with some NTP-server?

2003-06-06 Thread Alex de Kruijff
On Thu, Jun 05, 2003 at 09:55:39AM -0400, Tom Limoncelli wrote:
 [ I'm CC:'ing [EMAIL PROTECTED] so that he can add this as a How to 
 get started document to the web site. ]
 
 On Wednesday, June 4, 2003, at 03:37  PM, Constantine wrote:
 
 Hello!
 
 I am running FreeBSD 4.8. How can I synchronise my clock with some NTP 
 server? The time on my server right now is 4 minutes fast, and I do 
 not like that... Can I set up a script that would automatically 
 synchronise the time with some available server?
 
 My server is located in the USA, in case one would like to suggest 
 some good servers to synchronise with. :-)
 
 I don't think that read the man page is a very good answer.  The man 
 page doesn't explain things very well (if someone would like to submit 
 what I write below to the maintainer, please do so).
 
 

Hi,

The man page are not meant for this, there scope is limmited to the 
command. Books and article are. In fact the FreeBSD handbook have a 
section about this.

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-ntp.html

Alex

P.S. Its a good article. :-)
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Can I synchronise local time with some NTP-server?

2003-06-06 Thread Tom Limoncelli
On Thursday, June 5, 2003, at 01:11  PM, Alex de Kruijff wrote:

The man page are not meant for this, there scope is limmited to the
command. Books and article are. In fact the FreeBSD handbook have a
section about this.
Yet of all the email on this topic, nobody pointed out this most  
excellent article.

Of the many problems with the man page system, this is one that has  
always been a torn in my side.  I feel that man pages should have a  
getting started section, even if it only points to articles like the  
one you suggested.

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network- 
ntp.html


P.S. Its a good article. :-)
I agree.  It's a shame that the first place that people turn for help  
(the man pages) doesn't refer to it.

-tal

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Can I synchronise local time with some NTP-server?

2003-06-06 Thread Alex de Kruijff
On Thu, Jun 05, 2003 at 02:27:13PM -0400, Tom Limoncelli wrote:
 On Thursday, June 5, 2003, at 01:11  PM, Alex de Kruijff wrote:
 
 The man page are not meant for this, there scope is limmited to the
 command. Books and article are. In fact the FreeBSD handbook have a
 section about this.
 
 Yet of all the email on this topic, nobody pointed out this most  
 excellent article.

I was wondering about that to. Its not that hard to find, since it 
has a link on the main page of the website.

 Of the many problems with the man page system, this is one that has  
 always been a torn in my side.  I feel that man pages should have a  
 getting started section, even if it only points to articles like the  
 one you suggested.
 

There is usaly a refereal section at the end of the manual. It is a idee
to included a URL there. This is not possible for non-systems (aka 
comming from the ports).

 http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network- 
 ntp.html
 
 
 P.S. Its a good article. :-)
 
 I agree.  It's a shame that the first place that people turn for help  
 (the man pages) doesn't refer to it.

I meant you article here. (This may not have bin clear). I find the 
link is also good. 


I don't agree on the the shame part. I find the documentation of 
FreeBSD excelent. The startging point, realy, is the website 
(www.freebsd.org) and from there one can come to lots of mailinglist, 
newsgroups, article, and the handbook. I use FreeBSD for these reasons.
The handbook is the starting your looking for.

I feel that in this case the starter of this tread knew what he wanted to
do, but not knew what he needed. I feel that he never would have read 
one the manuals, because of that. This mailinglist is, amoung other 
questions, for questions like his.

Alex
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Can I synchronise local time with some NTP-server?

2003-06-05 Thread MikeM
On 6/4/03 at 3:37 PM Constantine wrote:
!
|
|I am running FreeBSD 4.8. How can I synchronise my clock with some NTP 
|server? The time on my server right now is 4 minutes fast, and I do not 
|like that... Can I set up a script that would automatically synchronise 
|the time with some available server?
|
|My server is located in the USA, in case one would like to suggest some 
|good servers to synchronise with. :-)
 =

man ntp
man ntpdate

http://www.ntp.org - look for the secondary servers to sync with.

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Can I synchronise local time with some NTP-server?

2003-06-05 Thread K Anderson


Constantine wrote:
Hello!

I am running FreeBSD 4.8. How can I synchronise my clock with some NTP 
server? The time on my server right now is 4 minutes fast, and I do not 
like that... Can I set up a script that would automatically synchronise 
the time with some available server?

My server is located in the USA, in case one would like to suggest some 
good servers to synchronise with. :-)

Cheers,
Constantine.
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to 
[EMAIL PROTECTED]

For a good time check out man ntpd and then do a google search on ntpd 
servers that are public and that should get you to having a good time 
with your clock.

And go from there.

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Can I synchronise local time with some NTP-server?

2003-06-05 Thread MikeM
On 6/4/03 at 3:44 PM MikeM wrote:

|On 6/4/03 at 3:37 PM Constantine wrote:
|!
||
||I am running FreeBSD 4.8. How can I synchronise my clock with some NTP 
||server? The time on my server right now is 4 minutes fast, and I do not 
||like that... Can I set up a script that would automatically synchronise 
||the time with some available server?
||
||My server is located in the USA, in case one would like to suggest some 
||good servers to synchronise with. :-)
| =
|
|man ntp
|man ntpdate
|
|http://www.ntp.org - look for the secondary servers to sync with.
 =


  man ntp 

should be 

  man ntpd

sorry for the typo

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Can I synchronise local time with some NTP-server?

2003-06-05 Thread Martin Krzysiak
On Wednesday 04 June 2003 21:37, Constantine wrote:

 I am running FreeBSD 4.8. How can I synchronise my clock with some NTP
 server? The time on my server right now is 4 minutes fast, and I do not
 like that... Can I set up a script that would automatically synchronise
 the time with some available server?

I guess, You are also trying to setup ntpd, because you believe the manpage 
about retired ntpdate. But it seems ntpdate is not retired. Just setup a 
cronjob which polls an ntp server. I think, ntpd does not work until you get 
explicit permission from the ntp-admin (you can write an email).

Martin

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Can I synchronise local time with some NTP-server?

2003-06-05 Thread Viktor Lazlo


On Wed, 4 Jun 2003, Constantine wrote:

 I am running FreeBSD 4.8. How can I synchronise my clock with some NTP
 server? The time on my server right now is 4 minutes fast, and I do not
 like that... Can I set up a script that would automatically synchronise
 the time with some available server?

The easiest way to do this is from
/stand/sysinstall/configure/networking/ntpdate, which will give you a list
of servers to select from.

Cheers,

Viktor

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Can I synchronise local time with some NTP-server?

2003-06-05 Thread Jez Hancock
On Wed, Jun 04, 2003 at 03:37:11PM -0400, Constantine wrote:
 Hello!
 
 I am running FreeBSD 4.8. How can I synchronise my clock with some NTP 
 server? The time on my server right now is 4 minutes fast, and I do not 
 like that... Can I set up a script that would automatically synchronise 
 the time with some available server?
Add:

xntpd_enable=YES
xntpd_flags=-l /var/log/ntpd.log # with logging

to /etc/rc.conf (this flag is different in 5.0 mind for anyone else that
tries this on 5.0) and then configure ntpd in /etc/ntpd.conf:

server ntp2a.mcc.ac.uk # choose a server near you obviously :)
driftfile /etc/ntp.drift

I think you might have to 'touch /etc/ntp.drift' initially - same with
/var/log/ntpd.log.

 My server is located in the USA, in case one would like to suggest some 
 good servers to synchronise with. :-)
As mentioned above check the official ntpd site - or even just google
for 'ntpd server usa'.

Cheers,
Jez
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]