Re: rdate issue

2007-05-14 Thread Stuart Henderson
On 2007/05/13 23:06, John Nietzsche wrote:
 */5 *   *   *   *   /usr/sbin/rdate -4ncva

-c corrects for leap seconds

 */5 *   *   *   *   /usr/sbin/rdate -4cva gw |

and here you do it again i.e. you are correcting time coming from a
source which is already corrected.

I would really recommend against using rdate like this, it jumps the
clock. ntpd skews the clock (makes it run slightly fast or slow until
the time is correct), so you don't miss out on any seconds (which
sometimes skips cron jobs, makes logging more confusing, and can
cause a lot of trouble with some other applications).



Re: rdate issue

2007-05-14 Thread Otto Moerbeek
On Mon, 14 May 2007, Stuart Henderson wrote:

 On 2007/05/13 23:06, John Nietzsche wrote:
  */5 *   *   *   *   /usr/sbin/rdate -4ncva
 
 -c corrects for leap seconds
 
  */5 *   *   *   *   /usr/sbin/rdate -4cva gw |
 
 and here you do it again i.e. you are correcting time coming from a
 source which is already corrected.
 
 I would really recommend against using rdate like this, it jumps the
 clock. ntpd skews the clock (makes it run slightly fast or slow until
 the time is correct), so you don't miss out on any seconds (which
 sometimes skips cron jobs, makes logging more confusing, and can
 cause a lot of trouble with some other applications).

While I agree with the advise, this is not true when the -a flag is
given to rdate, in that case rdate uses adjtime(2).

ntpd is of course much nicer, since its adjust the clock frequency as
well, and poses a very light stress on the server: once time is
synced, queries do not happen a lot. Not to speak of the ability to
use time sensors and multiple time sources to provide redundancy.

-Otto



Re: rdate issue

2007-05-14 Thread Adam Hawes
 I would really recommend against using rdate like this, it jumps the
 clock. ntpd skews the clock (makes it run slightly fast or slow until
 the time is correct), so you don't miss out on any seconds (which
 sometimes skips cron jobs, makes logging more confusing, and can
 cause a lot of trouble with some other applications).

the -a option fixes the skew problem.

-a  Use the adjtime(2) call to gradually skew the local time to the
remote time rather than just hopping.

I still recommend ntp if you need to continually update the clock.
It's always worked for me in the past.  Ntpd (AFIK) continually
monitors the difference between your clock and the remote server to
try and adjust the skew for a more accurate local clock.  Rdate doesn't.

Cheers,
A



rdate issue

2007-05-13 Thread John Nietzsche

Dear gentleman/madam,

i have a home network composed of 1 gateway and two boxes. All of them
running openbsd 4.1 of course.

I decided to get the time syncronization for all those boxes. In the
gateway machine, i managed to get the following in crontab:

*/5 *   *   *   *   /usr/sbin/rdate -4ncva
ptbtime1.ptb.de | /usr/bin/logger -t NTP


In the other two boxes (lion and etosha) i have:

*/5 *   *   *   *   /usr/sbin/rdate -4cva gw |
/usr/bin/logger -t NTP


Everything is working ok except because of those two boxes always have
a time about 20/22 seconds after my gateway time, like in the output
for date command:

[EMAIL PROTECTED] date
Sun May 13 23:04:35 BRT 2007
[EMAIL PROTECTED] date
Sun May 13 23:04:59 BRT 2007
[EMAIL PROTECTED] date
Sun May 13 23:04:59 BRT 2007

Does anybody have any ideia about why it is happening ?

Thanks in advance.

best regards.



Re: rdate issue

2007-05-13 Thread Nick Holland
John Nietzsche wrote:
...
 Everything is working ok except because of those two boxes always have
 a time about 20/22 seconds after my gateway time, like in the output
 for date command:
 
 [EMAIL PROTECTED] date
 Sun May 13 23:04:35 BRT 2007
 [EMAIL PROTECTED] date
 Sun May 13 23:04:59 BRT 2007
 [EMAIL PROTECTED] date
 Sun May 13 23:04:59 BRT 2007
 
 Does anybody have any ideia about why it is happening ?

yep.

http://www.openbsd.org/faq/faq8.html#NTPerror

ls -l /etc/localtime
on all three boxes will probably make it clear what is going on.
(look for the presence or absence of the word right in each...)

Nick.



Re: rdate issue

2007-05-13 Thread Adam Hawes
 I decided to get the time syncronization for all those boxes. In the
 gateway machine, i managed to get the following in crontab:

 */5 *   *   *   *   /usr/sbin/rdate -4ncva
 ptbtime1.ptb.de | /usr/bin/logger -t NTP

snip

 Everything is working ok except because of those two boxes always have
 a time about 20/22 seconds after my gateway time, like in the output
 for date command:

Have you considered running ntpd instead of rdate?  If nothing more, the
daemon removes the need to have crontabs updating the clock.

I have no explanation for why the times are about 20 seconds out other
than the gateway might be taking its time to wake up the rdate
daemon.

Cheers,
A



Re: rdate issue

2007-05-13 Thread Ted Unangst

On 5/13/07, John Nietzsche [EMAIL PROTECTED] wrote:


In the other two boxes (lion and etosha) i have:

*/5 *   *   *   *   /usr/sbin/rdate -4cva gw |
Everything is working ok except because of those two boxes always have
a time about 20/22 seconds after my gateway time, like in the output
for date command:


don't use -c.