Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Tip] Syncronisation de l'horloge avec un serveur NTP
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
shmal
Tux's lil' helper
Tux's lil' helper


Joined: 07 Aug 2004
Posts: 143
Location: France, 91

PostPosted: Mon Sep 06, 2004 3:57 pm    Post subject: [Tip] Syncronisation de l'horloge avec un serveur NTP Reply with quote

Peut être utile :
Code:
#emerger clockspeed
emerge clockspeed
# Un serveur ntp
ntp_server="138.195.130.71" #par exemple
# Pour voir le décalage
sntpclock $ntp_server | clockview
# Pour synchroniser
sntpclock $ntp_server | clockadd
# sntpclock $ntp_server | clockview #pour revérifer ;)



Un lien plus complet


Last edited by shmal on Mon Aug 29, 2005 8:39 am; edited 2 times in total
Back to top
View user's profile Send private message
scout
Veteran
Veteran


Joined: 08 Mar 2003
Posts: 1991
Location: France, Paris en Semaine / Metz le W-E

PostPosted: Mon Sep 06, 2004 4:36 pm    Post subject: Reply with quote

Merci, car moi avant je faisait ça avec ntp, mais clockspeed c'est plus léger.
Quote:
* net-misc/ntp
Latest version available: 4.2.0-r2
Latest version installed: 4.2.0-r2
Size of downloaded files: 2,480 kB
Homepage: http://www.ntp.org/
Description: Network Time Protocol suite/programs
License: as-is

à comparer aux 25 ko de clockspeed, mais il y a aussi rdate
Quote:
* net-misc/rdate
Latest version available: 990821-r1
Latest version installed: [ Not Installed ]
Size of downloaded files: 3 kB
Homepage: http://www.freshmeat.net/projects/rdate/
Description: use TCP or UDP to retrieve the current time of another machine
License: as-is

pour voir le décalage:
ntpdate -q ntp.tuxfamily.net
ou rdate ntp.tuxfamily.net
pour syncroniser, en root: ntpdate ntp.tuxfamily.net ou rdate -s ntp.tuxfamily.net

sinon il y a aussi dans ce paquet le démon ntp qui corrige progressivement les erreurs d'horloge, de manière à être tout le temps à la bonne heure à quelques secondes prêt.

Pour mettre l'heure à chaque démarrage, on peux taper les commandes précédentes dans local.start, ou alors:

/etc/conf.d/ntp-client wrote:
NTPCLIENT_CMD="ntpdate"
NTPCLIENT_OPTS="-b ntp.tuxfamily.net"

rc-update add ntp-client default
/etc/init.d/ntp-client start

Et sinon, merci pour m'avoir fait découvrir clockspeed! :)
_________________
http://petition.eurolinux.org/ - Petition against ePatents
L'essence de la finesse
Back to top
View user's profile Send private message
DuF
Advocate
Advocate


Joined: 09 Dec 2002
Posts: 2687
Location: Paris

PostPosted: Mon Sep 06, 2004 5:22 pm    Post subject: Reply with quote

Effectivement moi aussi j'utilisais ntp juste pour avoir le ntp-client... clockspeed étant bien plus léger c'est sympa comme tips, thx !
Back to top
View user's profile Send private message
kernelsensei
Bodhisattva
Bodhisattva


Joined: 22 Feb 2004
Posts: 5619
Location: Woustviller/Moselle/FRANCE (49.07°N;7.02°E)

PostPosted: Mon Sep 06, 2004 5:37 pm    Post subject: Reply with quote

ouais ca a l'air pas mal, vais peut etre passer a clockspeed :D

merci du tip :wink:
_________________
$ ruby -e'puts " .:@BFegiklnorst".unpack("x4ax7aaX6ax5aX15ax4aax6aaX7ax2aX5aX8 \
axaX3ax8aX4ax6aX3aX6ax3ax3aX9ax4ax2aX9axaX6ax3aX2ax4ax3aX4aXaX12ax10aaX7a").join'
Back to top
View user's profile Send private message
shmal
Tux's lil' helper
Tux's lil' helper


Joined: 07 Aug 2004
Posts: 143
Location: France, 91

PostPosted: Mon Sep 06, 2004 7:33 pm    Post subject: Reply with quote

De rien, c'est toujours un plaisir pour noob d'apprendre qqch à un vétéran ;) :D
Back to top
View user's profile Send private message
DuF
Advocate
Advocate


Joined: 09 Dec 2002
Posts: 2687
Location: Paris

PostPosted: Mon Sep 06, 2004 9:43 pm    Post subject: Reply with quote

Mon statut de vétéran n'indique qu'une chose, que je raconte des conneries depuis plus longtemps que les autres ;-)
En plus dans ce cas précis clockspeed est quand même carrément plus léger pour mon utilisation par rapport à ntp.
Back to top
View user's profile Send private message
rom
Apprentice
Apprentice


Joined: 21 Oct 2003
Posts: 246
Location: paris

PostPosted: Tue Sep 07, 2004 2:23 pm    Post subject: Reply with quote

Vraiment très bien clockspeed. Seulement dommage, il ne prend pas en compte les noms de domaine.

Last edited by rom on Tue Sep 07, 2004 4:28 pm; edited 1 time in total
Back to top
View user's profile Send private message
Dais
l33t
l33t


Joined: 05 Aug 2004
Posts: 977
Location: Québec

PostPosted: Tue Sep 07, 2004 2:29 pm    Post subject: Reply with quote

En passant, comment ça se fait qu'en me mettant sur le fuseau horaire de Montréal ( Canada/Eastern, GMT -5) et donc 6h de moins qu'en France, je me retrouve juste avec 4h de moins ? o_o
Back to top
View user's profile Send private message
kernelsensei
Bodhisattva
Bodhisattva


Joined: 22 Feb 2004
Posts: 5619
Location: Woustviller/Moselle/FRANCE (49.07°N;7.02°E)

PostPosted: Tue Sep 07, 2004 2:30 pm    Post subject: Reply with quote

heure hiver/ete ?
_________________
$ ruby -e'puts " .:@BFegiklnorst".unpack("x4ax7aaX6ax5aX15ax4aax6aaX7ax2aX5aX8 \
axaX3ax8aX4ax6aX3aX6ax3ax3aX9ax4ax2aX9axaX6ax3aX2ax4ax3aX4aXaX12ax10aaX7a").join'
Back to top
View user's profile Send private message
Dais
l33t
l33t


Joined: 05 Aug 2004
Posts: 977
Location: Québec

PostPosted: Tue Sep 07, 2004 2:32 pm    Post subject: Reply with quote

non, toujours 6h de décalage entre le Québec et la France (à part heure d'été où on change d'heure une semaine avant vous)
Back to top
View user's profile Send private message
rom
Apprentice
Apprentice


Joined: 21 Oct 2003
Posts: 246
Location: paris

PostPosted: Tue Sep 07, 2004 2:38 pm    Post subject: Reply with quote

il faut que ton bios indique l'heure en temps universel et pour ça mettre CLOCK="UTC" dans ton /etc/rc.conf.

Si tu utilises windoze en biboot gare : win la cochonne te remet l'heure en temps local sans te demander quoi que ce soit et il faut resynchroniser une fois arrivé ss linux.

-- rom


Last edited by rom on Tue Sep 07, 2004 4:27 pm; edited 1 time in total
Back to top
View user's profile Send private message
Dais
l33t
l33t


Joined: 05 Aug 2004
Posts: 977
Location: Québec

PostPosted: Tue Sep 07, 2004 2:40 pm    Post subject: Reply with quote

c'est déjà en CLOCK=UTC dans mon rc.conf

et oui, dualboot avec windows mais même à ça, ça n'explique pas pourquoi 4h et pas 6 ou 0 o_o
Back to top
View user's profile Send private message
rom
Apprentice
Apprentice


Joined: 21 Oct 2003
Posts: 246
Location: paris

PostPosted: Tue Sep 07, 2004 2:53 pm    Post subject: Reply with quote

As-tu mis à jour tes locales? As-tu fait env-update ? As-tu resynchronisé ?

Last edited by rom on Tue Sep 07, 2004 4:33 pm; edited 1 time in total
Back to top
View user's profile Send private message
scout
Veteran
Veteran


Joined: 08 Mar 2003
Posts: 1991
Location: France, Paris en Semaine / Metz le W-E

PostPosted: Tue Sep 07, 2004 3:11 pm    Post subject: Reply with quote

rom wrote:
Vraiment très bien clockspeed. Seulement dommage, il ne prends pas en compte les noms de domaine.

emerge host
puis avec un peu de bash,
Code:
geoffrey@scout> hostx ntp.tuxfamily.net
ntp.tuxfamily.net       A       212.85.158.2
ntp.tuxfamily.net       A       80.67.179.98
geoffrey@scout> hostx ntp.tuxfamily.net | head -n 1                                                                                 
ntp.tuxfamily.net       A       212.85.158.2
geoffrey@scout> hostx ntp.tuxfamily.net | head -n 1 | awk '{print $3}'
80.67.179.98

donc ntpserver=`hostx ntp.tuxfamily.net | head -n 1 | awk '{print $3}'` devrait pouvoir faire l'affaire ... sinon rdate sait prendre les noms de domaine et ne pèse que 3ko

Enfin moi je ne suis pas un pro du bash, peut être on peux faire encore mieux ...
_________________
http://petition.eurolinux.org/ - Petition against ePatents
L'essence de la finesse
Back to top
View user's profile Send private message
Dais
l33t
l33t


Joined: 05 Aug 2004
Posts: 977
Location: Québec

PostPosted: Tue Sep 07, 2004 3:18 pm    Post subject: Reply with quote

rom wrote:
As-tu mis à jour tes locales? As-tu fais env-update ? As-tu resynchronisé ?

oui oui oui
Back to top
View user's profile Send private message
scout
Veteran
Veteran


Joined: 08 Mar 2003
Posts: 1991
Location: France, Paris en Semaine / Metz le W-E

PostPosted: Tue Sep 07, 2004 10:24 pm    Post subject: Reply with quote

pour que ce ne soit pas la bataille avec windows, il faut mettre CLOCK="local" je crois
_________________
http://petition.eurolinux.org/ - Petition against ePatents
L'essence de la finesse
Back to top
View user's profile Send private message
sireyessire
Advocate
Advocate


Joined: 20 Mar 2003
Posts: 2991
Location: back in Paris, France

PostPosted: Wed Sep 08, 2004 7:28 am    Post subject: Reply with quote

scout wrote:
pour que ce ne soit pas la bataille avec windows, il faut mettre CLOCK="local" je crois

oui moi, j'en suis même sûr. :P
_________________
I never think of the future. It comes soon enough.
Albert Einstein

Try simpler first
Shockley
Back to top
View user's profile Send private message
Talosectos
Guru
Guru


Joined: 31 Aug 2004
Posts: 329
Location: Bugey-Libre

PostPosted: Thu Sep 09, 2004 8:15 am    Post subject: Reply with quote

sireyessire wrote:
scout wrote:
pour que ce ne soit pas la bataille avec windows, il faut mettre CLOCK="local" je crois

oui moi, j'en suis même sûr. :P

Je confirme aussi :D
_________________
Comité de lutte contre le language sms et les fautes volontaires
Utilisez la fonction recherche !
Back to top
View user's profile Send private message
fafounet
l33t
l33t


Joined: 03 Apr 2004
Posts: 703
Location: Meuves, France

PostPosted: Thu Sep 09, 2004 8:39 am    Post subject: Reply with quote

Apres m'être apercu que mon horlog était bien décalé j'ai voulu mettre à jour l'horloge. mais voila ce que j'ai :
Quote:

ntpdate -q ntp.tuxfamily.net
Looking for host ntp.tuxfamily.net and service ntp
host found : ntp.tuxfamily.net
9 Sep 10:31:00 ntpdate[28441]: setsockopt() IPV6_V6ONLY failed: Protocol not available
Back to top
View user's profile Send private message
Talosectos
Guru
Guru


Joined: 31 Aug 2004
Posts: 329
Location: Bugey-Libre

PostPosted: Thu Sep 09, 2004 8:50 am    Post subject: Reply with quote

Apparemment, ils sont après modifié les IP de leur serveurs
http://tuxfamily.net/
_________________
Comité de lutte contre le language sms et les fautes volontaires
Utilisez la fonction recherche !
Back to top
View user's profile Send private message
cylgalad
Veteran
Veteran


Joined: 18 Apr 2003
Posts: 1327
Location: France

PostPosted: Thu Sep 09, 2004 9:24 am    Post subject: Reply with quote

Des serveurs ntp :
- ntp.obspm.fr
- ntp.univ-lyon1.fr
- ntp.via.ecp.fr
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French All times are GMT
Page 1 of 1

 
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