Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to keep your clock on track.
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
szaman
n00b
n00b


Joined: 20 Jan 2004
Posts: 71
Location: Poland, Siemianowice

PostPosted: Thu Mar 25, 2004 10:18 pm    Post subject: Reply with quote

a nice link about win* ntp CLIENTS/servers:
http://geodsoft.com/howto/timesync/wininstall.htm
Back to top
View user's profile Send private message
szaman
n00b
n00b


Joined: 20 Jan 2004
Posts: 71
Location: Poland, Siemianowice

PostPosted: Thu Mar 25, 2004 10:49 pm    Post subject: Reply with quote

NetTime works perfect for me. (http://sourceforge.net/projects/nettime/).
Back to top
View user's profile Send private message
Cqwense
n00b
n00b


Joined: 28 Nov 2003
Posts: 52

PostPosted: Wed Apr 07, 2004 7:18 pm    Post subject: Reply with quote

Hi,

after emerging ntp , and adding a valid server to /etc/conf.d/ntp-client, i get the following error:

Code:
 * Re-caching dependency info (mtimes differ)...
 * Setting clock via the ntp client 'ntpd'...
ntpd: unknown option -Q
usage: ntpd [ -abdgmnqx ] [ -c config_file ] [ -e e_delay ]
                [ -f freq_file ] [ -k key_file ] [ -l log_file ]
                [ -p pid_file ] [ -r broad_delay ] [ -s statdir ]
                [ -t trust_key ] [ -v sys_var ] [ -V default_sysvar ]
                [ -P fixed_process_priority ]
                [ -u user[:group] ] [ -i chrootdir ]
 * Failed to set clock                                                    [ !! ]


There doesnt seem to be a -Q option for ntp-client anywhere, so I tried removing it from /etc/init.d/ntp-client. Afterwards i get:
Code:
 * Re-caching dependency info (mtimes differ)...
 * Setting clock via the ntp client 'ntpd'...
usage: ntpd [ -abdgmnqx ] [ -c config_file ] [ -e e_delay ]
                [ -f freq_file ] [ -k key_file ] [ -l log_file ]
                [ -p pid_file ] [ -r broad_delay ] [ -s statdir ]
                [ -t trust_key ] [ -v sys_var ] [ -V default_sysvar ]
                [ -P fixed_process_priority ]
                [ -u user[:group] ] [ -i chrootdir ]
 * Failed to set clock                                                    [ !! ]


im assuming maybe -Q is an attempt at a "quiet" option ( ? ) that emerge threw in ... but as you can see im still unable to use the service.

Anyways, thanks for reading

~ Cqwense
Back to top
View user's profile Send private message
szaman
n00b
n00b


Joined: 20 Jan 2004
Posts: 71
Location: Poland, Siemianowice

PostPosted: Wed Apr 07, 2004 7:45 pm    Post subject: Reply with quote

please, post your /etc/init.d/ntpd and /etc/conf.d/ntpd

regards
Back to top
View user's profile Send private message
viperlin
Veteran
Veteran


Joined: 15 Apr 2003
Posts: 1317
Location: UK

PostPosted: Wed Apr 07, 2004 7:53 pm    Post subject: Reply with quote

and Cqwense your avatar has scared me for life ;-)

strangely enough i have just been playing with ntp again due to rdate fucking up bigtime (reports wrong time on gentoo box's, my openBSD box gets the right time with rdate, so somethings up.

anyway from the output it looks like there is a -Q option that should not be in a config file
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5028
Location: Dark side of the mood

PostPosted: Sat May 22, 2004 12:19 pm    Post subject: Reply with quote

szaman wrote:
a nice link about win* ntp CLIENTS/servers:
http://geodsoft.com/howto/timesync/wininstall.htm


Adding my 2 cents: see http://support.microsoft.com/default.aspx?scid=kb;EN-US;216734 for more information on synchronizing the clock on a Win server.

Just issue the command net time /setsntp:server_list on your Windows server to synch on an external clock reference. Afterwards your server becomes an authoritative time server for the domain.

Why?

As M$ says, Kerberos authentication requires extreme clock accuracy. Tokens are generated on time basis. If machines clock get out of sync authentication might fail.

I have run the command with only one server and it works quite well. I am now syncing my Linux machine with the domain controller. Just for the fun. :)

As you can see there is no need for external tools. I just wonder why such an information has been made that hidden. People have to dig deep to find it most of the time.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
dylix
Apprentice
Apprentice


Joined: 20 Sep 2002
Posts: 261
Location: Atlanta

PostPosted: Sat May 22, 2004 8:41 pm    Post subject: Reply with quote

viperlin wrote:
and Cqwense your avatar has scared me for life ;-)

strangely enough i have just been playing with ntp again due to rdate fucking up bigtime (reports wrong time on gentoo box's, my openBSD box gets the right time with rdate, so somethings up.

anyway from the output it looks like there is a -Q option that should not be in a config file


make sure the timezones are set the same on both bawxes, and also make sure rc.conf is the same.. i think bsd has a rc.conf.. anywho, whether rc.conf says local or utc will affect your time aswell.
_________________

Rape is such a strong word, I prefer surprise sex.
http://plutonic.mine.nu/
Back to top
View user's profile Send private message
viperlin
Veteran
Veteran


Joined: 15 Apr 2003
Posts: 1317
Location: UK

PostPosted: Sat May 22, 2004 11:05 pm    Post subject: Reply with quote

fixed it a while ago, using Europe/London instead of GMT
Back to top
View user's profile Send private message
Lowspirit
Apprentice
Apprentice


Joined: 31 Jul 2002
Posts: 258
Location: Northern Sweden

PostPosted: Sun May 23, 2004 10:40 am    Post subject: Reply with quote

Huge thanks to BlauwVoet, your post/suggestion did exactly what I was looking for (ntp was overkill for the job).
_________________
Gentoo | AMD X2 3800+ 2GB RAM | Kernel 2.6.30 . ReiserFS . CFQ . GCC4.3.3 | Firefox 3.5 | Gnome 2.26 w/ Compiz-Fusion
"Penguins are the only fish that can fly"
Back to top
View user's profile Send private message
Yama
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jul 2002
Posts: 135
Location: Sydney, Australia

PostPosted: Tue Jun 01, 2004 2:52 pm    Post subject: Reply with quote

If you have multiple machines on your network, IMHO the best thing to do is to have the gateway box sync over the Internet via ntpd, but then have the clients sync with the gateway via something simpler. I keep a simple script in /etc/cron.hourly/ on each of these client machines:
Code:
if [ -x /usr/bin/ntpdate ]
then
   /usr/bin/ntpdate -b -s 192.168.0.1 && hwclock --systohc
fi

192.168.0.1 is the IP of the gateway on the LAN.

There's no need to have a daemon running 100% of the time, and ntpdate should suffice.
Back to top
View user's profile Send private message
Hauser
l33t
l33t


Joined: 27 Dec 2003
Posts: 650
Location: 4-dimensional hyperplane

PostPosted: Tue Jun 08, 2004 4:59 pm    Post subject: Reply with quote

BlauwVoet wrote:
the clockspeed command in the same ebuild resets the local clock each 3 seconds, it reads the real time measurements from /var/lib/clockspeed/adjust in TAI-format.
I haven't figured out (yet) how it works (because I'm quite satisfied with sntpclock/clockadd); feel free to experiment

Here's a nice page about clockspeed setup:
http://fte.tegtmeyer.net/djbware/clockspeed_setup.html
The clocksd package mentioned in the article can be quite useful:
http://www.guinix.com/software/clocksd.html
_________________
AMD Athlon XP 2600+; 512M RAM;
nVidia FX5700LE; Hitachi 120Gb
2.6.9-nitro4, reiser4, linux26-headers+nptl

Do I like to compile everything?
Positive definite!
Back to top
View user's profile Send private message
Negated Void
l33t
l33t


Joined: 25 Dec 2002
Posts: 665

PostPosted: Tue Jun 08, 2004 9:12 pm    Post subject: Reply with quote

How do i configure timezones/Daylight savings stuff? Both my linux boxes, using ntpd, are an hour off.
Back to top
View user's profile Send private message
viperlin
Veteran
Veteran


Joined: 15 Apr 2003
Posts: 1317
Location: UK

PostPosted: Tue Jun 08, 2004 10:56 pm    Post subject: Reply with quote

like in the gentoo guide when you pick the timezone, just pick the correct one and it's automatic. i had the same problem until i picked a city for a timezone instead of GMT
Back to top
View user's profile Send private message
Major
Apprentice
Apprentice


Joined: 27 Feb 2004
Posts: 198
Location: Sherbrooke, Qc, Canada

PostPosted: Sun Jun 13, 2004 10:38 am    Post subject: Reply with quote

I have some trouble with my ntpd and ntp-client ... maybe there is something I dont understand but here :

I have install and setuped ntpd and ntp-client ... but my clock isn't correct.

I have to do each time I want to set my clock
Code:

ntpdate SERVER_ADDDRESS
killall gnome-panel

to have my clock set on my bar but not on my gkrellm2 clock.

so I guess I set something wrong or should ntp-client update (using ntpdate) via ntpd which should set itself with the list of server I set in a config file ?

Major
Back to top
View user's profile Send private message
Andersson
Guru
Guru


Joined: 12 Jul 2003
Posts: 525
Location: Göteborg, Sweden

PostPosted: Sun Jun 13, 2004 10:40 pm    Post subject: Reply with quote

Major wrote:
I have some trouble with my ntpd and ntp-client ... maybe there is something I dont understand but here :

I have install and setuped ntpd and ntp-client ... but my clock isn't correct.

I have to do each time I want to set my clock
Code:

ntpdate SERVER_ADDDRESS
killall gnome-panel

to have my clock set on my bar but not on my gkrellm2 clock.

so I guess I set something wrong or should ntp-client update (using ntpdate) via ntpd which should set itself with the list of server I set in a config file ?

Major

It works when you use ntpdate from the command line, when you specify a server adress? Then perhaps ntpd and ntp-client can't find any servers to connect to, a spelling error in the config perhaps? What do you see if you type ntpq -p (when ntpd is running)? Could you post your config files? (/etc/ntp.conf and /etc/conf.d/ntp-client).
_________________
Must...resist...posting....
One...step...closer...to...getting...stupid...l33t...ranking...
Back to top
View user's profile Send private message
Major
Apprentice
Apprentice


Joined: 27 Feb 2004
Posts: 198
Location: Sherbrooke, Qc, Canada

PostPosted: Mon Jun 14, 2004 1:44 am    Post subject: Reply with quote

Code:
root # ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 CLOCK.uregina.c .INIT.          16 u    -   64    0    0.000    0.000 4000.00
 sue.cc.uregina. .INIT.          16 u    -   64    0    0.000    0.000 4000.00
 ensb.cpsc.ucalg .INIT.          16 u    -   64    0    0.000    0.000 4000.00
 wxo-svr1.cmc.ec .INIT.          16 u    -   64    0    0.000    0.000 4000.00
 wxo-svr2.cmc.ec .INIT.          16 u    -   64    0    0.000    0.000 4000.00


Code:
root # cat /etc/ntp.conf
...
#server         ntp.example.tld         iburst
#University of Regina
server clock.uregina.ca
server timelord.uregina.ca
#University of Calgary
server ntp.cpsc.ucalgary.ca
#Canadian Meteorological Centre
server ntp1.cmc.ec.gc.ca
server ntp2.cmc.ec.gc.ca
 
##
# -=JAY=-
# Verify that correct time was set by going to
# http://tycho.usno.navy.mil/cgi-bin/timer.pl
# (for North American time zones only)
##
 
# you should not need to modify the following paths
logfile         /var/log/ntpd.log
driftfile       /var/lib/ntp/ntp.drift
 
restrict default ignore
 
#restrict default notrust nomodify
restrict 127.0.0.1
restrict 192.168.1.3

#restrict 192.168.1.0 mask 255.255.255.0 notrust nomodify notrap

Code:
root # cat /etc/conf.d/ntp-client
...
NTPCLIENT_CMD="ntpdate"
 
#NTPCLIENT_OPTS="-b someserver"
NTPCLIENT_OPTS="-b clock.uregina.ca"
Back to top
View user's profile Send private message
Andersson
Guru
Guru


Joined: 12 Jul 2003
Posts: 525
Location: Göteborg, Sweden

PostPosted: Mon Jun 14, 2004 1:37 pm    Post subject: Reply with quote

I think it's the restrict default ignore. Try adding this:
Code:
restrict clock.uregina.ca nomodify
restrict timelord.uregina.ca nomodify

...and so on for all your servers. By the way, two or three servers is enough ;)
_________________
Must...resist...posting....
One...step...closer...to...getting...stupid...l33t...ranking...
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2571
Location: Edmonton, AB

PostPosted: Fri Jun 18, 2004 11:13 pm    Post subject: Reply with quote

Here is my sript to adjust the time:

Firtst:
emerge rdate

Make a script:
#!/bin/sh
rdate -s time.nist.gov #or your favorite server
hwclock --systohc

That is all (run it as root), your time and date will be synchronized to one of the time servers you set. Enjoy!
_________________
#Thelma
Back to top
View user's profile Send private message
NiK[IT]
Tux's lil' helper
Tux's lil' helper


Joined: 28 May 2004
Posts: 91

PostPosted: Mon Jun 21, 2004 11:49 am    Post subject: Reply with quote

I feel stupid but after configuring the ntpd system clock shows the wrong hour (I live in Italy so GMT+1). It shows my current time -2.
Its surely a problem of localization that I've missed out...
Anyone can help?
thx
Back to top
View user's profile Send private message
lucaberta
n00b
n00b


Joined: 22 Jun 2004
Posts: 10
Location: Milano, Italy

PostPosted: Wed Jun 30, 2004 1:45 pm    Post subject: Reply with quote

NiK,

you don't live in GMT+1... GMT+1 doesn't change with the Daylight Savings Time, as GMT doesn't change!

Your /etc/localtime should instead be something like

Code:
lrwxrwxrwx  1 root root 23 Jun  5 12:28 localtime -> /usr/share/zoneinfo/CET

like it is in my case.

The good thing about Unix is its marvelous support of timezones and UTC, as long as it is well configured! :)

Ciao, Luca
Back to top
View user's profile Send private message
naelr
n00b
n00b


Joined: 10 Aug 2003
Posts: 33

PostPosted: Fri Jul 02, 2004 5:01 am    Post subject: Reply with quote

OK I live in WV so I should be eastern standard time.. what is the difference between EST and EST5EDT

Has anyone had a problem using their router with shorewall and trying to use it for an NTP server... I can't get my local machines to get the time from it... I think I might be missing something in the shorewall configuration... when I try to rdate 192.168.0.1 I get connection refused... can anyone start me in the right direction?

Naelr
Back to top
View user's profile Send private message
lucaberta
n00b
n00b


Joined: 22 Jun 2004
Posts: 10
Location: Milano, Italy

PostPosted: Fri Jul 02, 2004 10:19 am    Post subject: Reply with quote

naelr wrote:
OK I live in WV so I should be eastern standard time.. what is the difference between EST and EST5EDT


I'd say that the former would not do any Daylight Savings Time change, while the latter takes care of switching to DST automagically.

Remember, it's Eastern Standard Time in the winter, and Eastern Daylight Time in the summer, unless WV does the same as Arizona, not changing to DST.

Bye, Luca
Back to top
View user's profile Send private message
naelr
n00b
n00b


Joined: 10 Aug 2003
Posts: 33

PostPosted: Fri Jul 02, 2004 11:41 am    Post subject: Reply with quote

yes we do change to DST thanks that was what I was missing... anyone have any idea on my other problem?
Back to top
View user's profile Send private message
dj_farid
l33t
l33t


Joined: 14 Jun 2004
Posts: 613

PostPosted: Sat Jul 03, 2004 4:27 pm    Post subject: Reply with quote

I have the same script as Joseph_sys. When I set the date, it sets it two hours behind.
My rc-conf is set lo local time.
I didn't have the /etc/localtime link before, but I made it now.
#ln -sf /usr/share/zoneinfo/CET /etc/localtime

It still sets the time two hours behind. What could be wrong?
Back to top
View user's profile Send private message
lucaberta
n00b
n00b


Joined: 22 Jun 2004
Posts: 10
Location: Milano, Italy

PostPosted: Sat Jul 03, 2004 4:35 pm    Post subject: Reply with quote

dj_farid wrote:
I have the same script as Joseph_sys. When I set the date, it sets it two hours behind.
My rc-conf is set lo local time.
I didn't have the /etc/localtime link before, but I made it now.
#ln -sf /usr/share/zoneinfo/CET /etc/localtime

It still sets the time two hours behind. What could be wrong?

Not sure what could be the problem, as I don't use rdate but rather run a full NTP server on my system.

Remember that you can always check that Linux has the right UTC time by using the command "date -u" to show UTC time instead of local time. Currently UTC is behing CET by two hours as we're on summertime, so apparently rdate is not setting date according to your local time clock setting.

Ciao, Luca
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum