Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[ntpd] no acaba de sincronizarme la hora. abierto
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Spanish
View previous topic :: View next topic  
Author Message
zorth
l33t
l33t


Joined: 17 Feb 2004
Posts: 780
Location: Lovin' Gentoo

PostPosted: Sun Mar 06, 2005 9:16 pm    Post subject: [ntpd] no acaba de sincronizarme la hora. abierto Reply with quote

hola.

estoy desde hace unos dias liado con ntpd, tengo el puerto 123 udp mapeado en el router y ntpd funciona al igual que ntp-client que me actualiza la hora correctamente, sin embargo, ntpd no acaba de sincronizarme mi pc con los servidores a los que conecto. si alguien ve una mala configuracion en mis archivos estaria agradecido me corrigiera pues casi estoy seguro que es solo eso, una mala configuracion por algun sitio.

pongo mi configuracion asi como los resultados:

Code:


dom mar 06 22:12:48 Kronos zorth # ll /etc | grep ntp.conf
-r--------   1 root root    1,7K mar  4 23:54 ntp.conf





Code:


dom mar 06 22:13:09 Kronos zorth # cat /etc/ntp.conf
# NOTES:
#  - you should only have to update the server line below
#  - if you start getting lines like 'restrict' and 'fudge'
#    and you didnt add them, AND you run dhcpcd on your
#    network interfaces, be sure to add '-Y -N' to the
#    dhcpcd_ethX variables in /etc/conf.d/net

# Name of the servers ntpd should sync with
# Please respect the access policy as stated by the responsible person.
#server         ntp.example.tld         iburst

#server slug.ctv.es

server ntp.escomposlinux.org prefer
server hora.unex.es
server ntps.net4u.it
server tock.fh-augsburg.de

##
# A list of available servers can be found here:
# http://www.pool.ntp.org/
# http://www.pool.ntp.org/#use
# A good way to get servers for your machine is:
# netselect -s 3 pool.ntp.org
##

# you should not need to modify the following paths
driftfile       /var/lib/ntp/ntp.drift

#server ntplocal.example.com prefer
#server timeserver.example.org

# Warning: Using default NTP settings will leave your NTP
# server accessible to all hosts on the Internet.

# If you want to deny all machines (including your own)
# from accessing the NTP server, uncomment:
#restrict ignore nomodify nopeer


# To deny other machines from changing the
# configuration but allow localhost:
#restrict default nomodify nopeer
restrict 127.0.0.1
restrict 192.168.1.0 nomodify notrust nopeer
#server 127.127.1.0 # local clock
#fudge 127.127.1.0 stratum 10

# To allow machines within your network to synchronize
# their clocks with your server, but ensure they are
# not allowed to configure the server or used as peers
# to synchronize against, uncomment this line.
#
#restrict 192.168.1.0 mask 255.255.255.0 nomodify nopeer notrap
#restrict default nomodify nopeer




Code:


dom mar 06 22:13:39 Kronos zorth # cat /etc/conf.d/ntp-client
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/ntp/files/ntp-client.confd,v 1.10 2005/01/28 22:37:09 vapier Exp $

# Command to run to set the clock initially
# Most people should just leave this line alone ...
# however, if you know what you're doing, and you
# want to use ntpd to set the clock, change this to 'ntpd'
NTPCLIENT_CMD="ntpdate"

# Options to pass to the above command
# This default setting should work fine but you should
# change the default 'pool.ntp.org' to something closer
# to your machine.  See http://www.pool.ntp.org/ or
# try running `netselect -s 3 pool.ntp.org`.
NTPCLIENT_OPTS="-b ntp.escomposlinux.org"
# hora.oxixares.com slug.ctv.es"

# How long to wait (in seconds) before giving up.
# Useful for when you boot and DNS/internet isn't
# really available but you have your net interface
# come up with say a static IP.
NTPCLIENT_TIMEOUT=10



Code:

dom mar 06 22:14:23 Kronos zorth # cat /etc/conf.d/ntpd
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/ntp/files/ntpd.confd,v 1.15 2004/07/15 00:05:46 agriffis Exp $

# Options to pass to the ntpd process
# Most people should leave this line alone ...
# however, if you know what you're doing, feel free to tweak
NTPD_OPTS="-u ntp:ntp"
NTPCLIENT_OPTS="-b ntp.escomposlinux.org"
NTPCLIENT_OPTS="-b hora.unex.es"
NTPCLIENT_OPTS="-b ntps.net4u.it"
NTPCLIENT_OPTS="-b tock.fh-augsburg.de"



Code:

dom mar 06 22:14:50 Kronos zorth # cat /var/lib/ntp/ntp.drift
0.000



Code:

dom mar 06 22:15:29 Kronos zorth # ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 217.125.14.244  129.132.2.21     2 u  943 1024  377  134.071  -79606. 8139.31
 158.49.8.2      130.206.3.166    2 u  928 1024  377   78.407  -79731. 8164.72
 80.83.192.129   130.149.17.21    2 u  930 1024  377  165.411  -79697. 8156.30
 141.82.30.252   130.149.17.8     2 u  930 1024  377  132.481  -79708. 8176.80



y ahi queda todo, como se puede ver, no acaba de sincronizar mi pc con ningun servidor, pues en los manuales y capturas que otra gente pone, junto a la ip del servidor suele venir un + - * y a mi, asi se queda.

el reloj por eso, sigue adelantandose el solito como de costumbre. a que creeis que puede deberse que no acabe el servicio de ntpd de funcionar ok ?

ntpd y ntp-client los tengo ambos en el init como default.

saludos.
_________________
Geŋtoo Worłd Rułe§
Back to top
View user's profile Send private message
Arkantos
n00b
n00b


Joined: 13 Oct 2004
Posts: 24
Location: El Montseny

PostPosted: Wed Mar 09, 2005 10:52 pm    Post subject: Reply with quote

Quizas es una tonteria pero prueba manual con un servidor conocido:

Code:

#!/bin/bash
ntpdate ntp.tuxfamily.net


si te funciona ponlo en un cron y listo
_________________
El ser humano siempre tiende a complicar lo fácil...
Back to top
View user's profile Send private message
urcindalo
l33t
l33t


Joined: 08 Feb 2005
Posts: 623
Location: Almeria, Spain

PostPosted: Thu Mar 10, 2005 7:16 pm    Post subject: Reply with quote

Estaba buscando la solución al adelanto del reloj de mi AMD64, y me he encontrado con este mismo tema y con este otro: Clock keeps losing sync.

En el otro, desaconsejan el uso del cron para mantener el reloj en hora, y proponen otra solución mucho más elegante.
En cuanto pueda la probaré, ya que necesito tener ntp, para ello necesito swig como dependencia, y para mi desgracia a éste no le da la gana de compilarse. Si a alguien le interesa, tengo el problema explicado aquí.
Back to top
View user's profile Send private message
focahclero
Guru
Guru


Joined: 02 Jan 2004
Posts: 554

PostPosted: Fri Mar 11, 2005 1:28 pm    Post subject: Re: [ntpd] no acaba de sincronizarme la hora. abierto Reply with quote

zorth wrote:
pongo mi configuracion asi como los resultados:


En el /etc/ntp.conf prueba a quitar el "notrust" que tienes en la línea "restrict"
En /etc/conf.d/ntpd yo sólo tengo NTPD_OPTS="-u ntp:ntp" (el resto no sé si influye o no, pero sólo con esta línea me funciona)

Después de reiniciar el servicio ntpd, prueba como sabes:
Code:
# ntpq
ntpq> pe
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*gf158.internetd 192.53.103.103   2 u   83  128  377  141.179   -7.211  25.431

ntpq> rv
(...)
processor="i686", system="Linux/2.6.10-gentoo-r6", leap=00, stratum=16,
(...)
ntpq> rv
status=06a4 leap_none, sync_ntp, 10 events, event_peer/strat_chg,
version="ntpd 4.2.0@1.1161-r Tue Feb  8 11:39:41 CET 2005 (1)",
processor="i686", system="Linux/2.6.10-gentoo-r6", leap=00, stratum=3,
precision=-20, rootdelay=174.016, rootdispersion=270.695, peer=11252,
refid=80.53.57.158,
reftime=c5dc19d4.6a674080  Fri, Mar 11 2005 14:21:24.415, poll=7,
clock=c5dc1a2a.0eea0fd3  Fri, Mar 11 2005 14:22:50.058, state=4,
offset=-7.211, frequency=32.905, jitter=16.001, stability=1.933

La primera vez te indicará un "stratum=16"... y pasado un rato (quizás 30 minutos) deberías tener un "stratum=3".... o lo que es lo mismo, el servidor estará correctamente sincronizado y debería permitir sincronizar, a su vez, a tus clientes.

Y por cierto, yo también me estuve pegando unos días con el ntp... pero ahora parece que ya me funciona bien.

Saludos,
_________________
focahclero
Registered Linux User #352648. Get Counted! http://counter.li.org
[TEMA] Descripción problema (estado)


Last edited by focahclero on Thu Mar 17, 2005 1:32 pm; edited 1 time in total
Back to top
View user's profile Send private message
zorth
l33t
l33t


Joined: 17 Feb 2004
Posts: 780
Location: Lovin' Gentoo

PostPosted: Mon Mar 14, 2005 11:15 pm    Post subject: Reply with quote

hola.

gracias de nuevo por las respuestas. pero el problema persiste y ya, no se que mas probar :)

el reloj va a su bola, ntpd sigue sin sincronizar y he probado lo imposible en configuraciones de los archivos necesarios como /etc/ntpd.conf y /etc/conf.d/ntpd

lo unico y ultimo que queda por probar ya es usar un nucleo distinto y en ello voy a ponerme ahora mismo, pues acabo de emerger las gentoo-dev-sources-2.6.11-r3, actualmente uso las 2.6.10-r6

como no sea tema de nucleo...

saludos.
_________________
Geŋtoo Worłd Rułe§
Back to top
View user's profile Send private message
Ijo
n00b
n00b


Joined: 22 Jul 2003
Posts: 68

PostPosted: Wed Mar 16, 2005 4:06 pm    Post subject: Re: [ntpd] no acaba de sincronizarme la hora. abierto Reply with quote

zorth wrote:
hola.
pongo mi configuracion asi como los resultados:
Code:

dom mar 06 22:12:48 Kronos zorth # ll /etc | grep ntp.conf
-r--------   1 root root    1,7K mar  4 23:54 ntp.conf



Hola, te voy poniendo la mia. He quitado los # para más claridad.
Code:

# ls -al /etc/ntp.conf
-rw-r--r--  1 root root 1637 Jan  4 12:38 /etc/ntp.conf


zorth wrote:

Code:

dom mar 06 22:13:09 Kronos zorth # cat /etc/ntp.conf
server ntp.escomposlinux.org prefer
server hora.unex.es
server ntps.net4u.it
server tock.fh-augsburg.de
driftfile       /var/lib/ntp/ntp.drift
restrict 127.0.0.1
restrict 192.168.1.0 nomodify notrust nopeer



La mia
Code:

# more /etc/ntp.conf
server 80.253.108.112
logfile  /var/log/ntpd.log

driftfile       /var/lib/ntp/ntp.drift

restrict 80.253.108.112 mask 255.255.255.255 nomodify notrap noquery
restrict 127.0.0.1

restrict 192.168.1.0 mask 255.255.255.0 notrust nomodify notrap


zorth wrote:

Code:

dom mar 06 22:13:39 Kronos zorth # cat /etc/conf.d/ntp-client
...recortado...



Yo NO uso ntp-client. Sólo ntpd.

zorth wrote:

Code:

dom mar 06 22:14:23 Kronos zorth # cat /etc/conf.d/ntpd
NTPD_OPTS="-u ntp:ntp"
NTPCLIENT_OPTS="-b ntp.escomposlinux.org"
NTPCLIENT_OPTS="-b hora.unex.es"
NTPCLIENT_OPTS="-b ntps.net4u.it"
NTPCLIENT_OPTS="-b tock.fh-augsburg.de"



Mi config /etc/conf.d/ntpd
Code:

# cat /etc/conf.d/ntpd
NTPD_OPTS="-u ntp:ntp"


zorth wrote:

Code:

dom mar 06 22:14:50 Kronos zorth # cat /var/lib/ntp/ntp.drift
0.000



Mi ntp.drift
Code:

# cat /var/lib/ntp/ntp.drift
-26.478


zorth wrote:

Code:

dom mar 06 22:15:29 Kronos zorth # ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 217.125.14.244  129.132.2.21     2 u  943 1024  377  134.071  -79606. 8139.31
 158.49.8.2      130.206.3.166    2 u  928 1024  377   78.407  -79731. 8164.72
 80.83.192.129   130.149.17.21    2 u  930 1024  377  165.411  -79697. 8156.30
 141.82.30.252   130.149.17.8     2 u  930 1024  377  132.481  -79708. 8176.80



Mi ntpq -pn
Code:

#  ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*80.253.108.112  193.63.105.18    2 u  659 1024  377   79.841   -0.036  15.933


Verifica también que el reloj hardware este (más o menos) correcto. Las implementaciones de ntp suelen tener problemas cuando el hardware está muy desviado. No sincronizan nunca. Prueba con mis configs (adaptadas a tu caso) y apaga y pon bien la hora del pc en la bios. Luego vuelve a probar.
Si no te funciona ya no se que puede ser...

Sólo tengo ntpd en default. No te hace falta ntp-client.

Espero que te sirva de ayuda.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Spanish 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