Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solucionado] Hora incorrecta
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
dalele
n00b
n00b


Joined: 17 Apr 2013
Posts: 6

PostPosted: Wed Apr 17, 2013 8:38 am    Post subject: [Solucionado] Hora incorrecta Reply with quote

Hola.
Tengo un problema con la hora. Teniendo configurado el sistema según http://www.gentoo.org/doc/es/guide-localization.xml me aparece la hora dos horas adelantada.

Code:
# cat /etc/timezone
Europe/Madrid


Code:
# cat /etc/conf.d/hwclock
# Set CLOCK to "UTC" if your Hardware Clock is set to UTC (also known as
# Greenwich Mean Time).  If that clock is set to the local time, then
# set CLOCK to "local".  Note that if you dual boot with Windows, then
# you should set it to "local".
clock="local"

# If you want the hwclock script to set the system time (software clock)
# to match the current hardware clock during bootup, leave this
# commented out.
# However, you can set this to "NO" ifyou are running a modern kernel
# with CONFIG_RTC_HCTOSYS set to y and your hardware clock set to UTC.
clock_hctosys="YES"

# If you do not want to set the hardware clock to the current system
# time (software clock) during shutdown, set this to no.
#clock_systohc="YES"

# If you wish to pass any other arguments to hwclock during bootup,
# you may do so here. Alpha users may wish to use --arc or --srm here.
clock_args=""


Y ya he ejecutado el:
Code:
cp /usr/share/zoneinfo/Europe/Madrid /etc/localtime


En /etc/conf.d/hwclock he probado con UTC y con local

Haga lo que haga, siempre tengo la hora adelantada 120 minutos.

¿Alguna idea?
Gracias.


Last edited by dalele on Sat Apr 20, 2013 9:44 am; edited 3 times in total
Back to top
View user's profile Send private message
quilosaq
Veteran
Veteran


Joined: 22 Dec 2009
Posts: 1520

PostPosted: Wed Apr 17, 2013 5:50 pm    Post subject: Reply with quote

Si quieres dejar la variable clock="local" en /etc/conf.d/hwclock asegurate que tu reloj hardware esta marcando la hora local real
Code:
# hwclock
Back to top
View user's profile Send private message
dalele
n00b
n00b


Joined: 17 Apr 2013
Posts: 6

PostPosted: Wed Apr 17, 2013 10:40 pm    Post subject: Reply with quote

Pues no entiendo nada.
Acabo de encender el ordenador y ahora me aparece bien.
El reloj hardware está bien porque en Windows y en Ubuntu la hora sale bien.
Creo que la clave ha sido clock_hctosys="YES", que me parece que ha sido lo último que he cambiado mientras hacía pruebas.
Tal vez no reinicié en el último cambio.

Saludos y gracias.
Back to top
View user's profile Send private message
deovex
n00b
n00b


Joined: 27 Jun 2007
Posts: 74
Location: Buenos Aires, Argentina.

PostPosted: Wed Apr 17, 2013 11:59 pm    Post subject: Reply with quote

Aprovecho preguntar sobre la duda que tengo, en el archivo /etc/conf.d/hwclock lo tengo configurado como "local". Pero al ejecutar hwclock me sale la hora diferente:

Code:
localhost dov # date
mié abr 17 20:54:23 ART 2013
localhost dov # hwclock
mié 17 abr 2013 17:54:27 ART  -0.953379 segundos
localhost dov #


Que puede ser?
Back to top
View user's profile Send private message
quilosaq
Veteran
Veteran


Joined: 22 Dec 2009
Posts: 1520

PostPosted: Thu Apr 18, 2013 12:32 am    Post subject: Reply with quote

¿Qué devuelve
Code:
# hwclock -r --localtime
? ¿Coincide con tu hora local?
Back to top
View user's profile Send private message
deovex
n00b
n00b


Joined: 27 Jun 2007
Posts: 74
Location: Buenos Aires, Argentina.

PostPosted: Thu Apr 18, 2013 1:00 am    Post subject: Reply with quote

Code:
localhost dov # hwclock -r --localtime
mié 17 abr 2013 21:56:31 ART  -0.426514 segundos


Coincide con la hora local.
Back to top
View user's profile Send private message
quilosaq
Veteran
Veteran


Joined: 22 Dec 2009
Posts: 1520

PostPosted: Thu Apr 18, 2013 1:42 am    Post subject: Reply with quote

Si
Code:
# hwclock -r --localtime
coincide con tu hora local y
Code:
# hwclock -r
no coincide quiere decir que no tienes configurada la variable clock="local" en /etc/conf.d/hwclock o que no es tenida en cuenta por ejemplo porque /etc/init.d/hwclock no se ejecuta en el arranque.
Back to top
View user's profile Send private message
dalele
n00b
n00b


Joined: 17 Apr 2013
Posts: 6

PostPosted: Thu Apr 18, 2013 7:17 am    Post subject: Reply with quote

Ya sé lo que ha pasado.
En realidad el clock_hctosys="YES" no ha tenido nada que ver.
He dejado clock="local" sin más y funciona.

Lo que ha pasado es que tenía el reloj en UTC, por lo que me ponía la hora mal.
Cuando lo cambié por local y volví a entrar en Gentoo la hora ya estaba mal en el reloj hardware.
Después entré en Ubuntu, que me actualiza la hora desde internet y me puso la correcta, por lo que al volver a entrar a Gentoo ya estaba bien.

Si no lo entiendo mal la hora de hwclock -r --localtime y hwclock -r deben ser distntas, porque la primera es teniendo en cuenta nuestra configuración local y la segunda es sin tenerla en cuenta, por lo que, a menos que coincida nuestra hora local con la UTC, deben ser diferentes.

Saludos y gracias.
Back to top
View user's profile Send private message
esteban_conde
Veteran
Veteran


Joined: 04 Jun 2003
Posts: 1670

PostPosted: Thu Apr 18, 2013 1:17 pm    Post subject: Reply with quote

Si cambias de sistema operativo a menudo tendrás problemas con esa configuracion.
No he leido más que el último mensaje por lo que pueden haber posteado ya lo siguiente:
emerge ntp-client y ponlo en el runlevel default.
_________________
Saludos a tod@s, Esteban.
Back to top
View user's profile Send private message
dalele
n00b
n00b


Joined: 17 Apr 2013
Posts: 6

PostPosted: Fri Apr 19, 2013 6:26 am    Post subject: Reply with quote

ntp-client parece que no está en el portage, pero he encontrado esto http://en.gentoo-wiki.com/wiki/Time_Synchronization y he instalado y añadido el script openrdate a default.

Saludos y gracias
Back to top
View user's profile Send private message
esteban_conde
Veteran
Veteran


Joined: 04 Jun 2003
Posts: 1670

PostPosted: Fri Apr 19, 2013 8:43 am    Post subject: Reply with quote

Siento no haber sido lo suficientemente explicito:
Quote:
net-misc/ntp
Latest version available: 4.2.6_p5-r1
Latest version installed: 4.2.4_p6
Size of files: 4,150 kB
Homepage: http://www.ntp.org/
Description: Network Time Protocol suite/programs
License: HPND BSD ISC

Lo que pasa es que ntp-client viene incluido en ese paquete, pero como demonio solamente hay que poner ntp-client, por otro lado si te va bién con lo que tienes instalado no lo toques, a mi me lleva funcionando ntp-client muy bien desde hace bastante, eso si, no he averiguado que paquete es opensource ni cual no, solamente me he fijado en que se instala con emerge sin grandes requisitos.
_________________
Saludos a tod@s, Esteban.
Back to top
View user's profile Send private message
papu
l33t
l33t


Joined: 25 Jan 2008
Posts: 707
Location: Sota algun pi o alzina...

PostPosted: Fri Apr 19, 2013 7:57 pm    Post subject: Reply with quote

yo uso sistema dual con UTC y me pasaba lo de las dos horas(por el cambio horario de verano), al final tocando a mano la hora y con clock_systohc="YES" he conseguido que vaya bien , pero ¿no tendría que hacerlo el sistema mismo con ntp?...quizas lo tengo mal configurado porque yo entendí que el paquete ntp al contener ya ntp-client al activar ntpd ya lo hacía solo ¿estoy equivocado y he de poner npt-client en default y quitar ntpd o mantener ambos?

ahora esta asi
Code:

.
.
.ntp-client               
 ntpd                      default
.
.
.


esto de la hora al reinstalar el linux siempre me da problems porque me olvido de como funciona siempre.

Al final he puesto local y openrdate que es muy sencillo y ale.

lo que pasa es que el rc.log veo que inicia antes que la red y entonces no conecta, ¿como se hace para poner el servicio despues de eth0?
Code:
 * Setting clock via openrdate ...
openrdate: pool.ntp.org: Name or service not known
 * Failed to set clock via openrdate
 [ !! ]

ad1
_________________
"~amd64" --cpu 7700 non-x --DDR5 2x16GB 6000MHz --gpu RX 470
Back to top
View user's profile Send private message
dalele
n00b
n00b


Joined: 17 Apr 2013
Posts: 6

PostPosted: Sat Apr 20, 2013 6:44 am    Post subject: Reply with quote

Vaya, pues es verdad. Acabo de comprobar que el openrdate estaba parado en los servicios.
Y he instalado ntp y añadido ntp-client a default y le pasa lo mismo, los dos intentan comprobar la hora antes de tener la conexión a internet.

Respecto a ntp-client y ntpd:

Code:
 * The way ntp sets and maintains your system time has changed.
 * Now you can use /etc/init.d/ntp-client to set your time at
 * boot while you can use /etc/init.d/ntpd to maintain your time
 * while your machine runs


Saludos.

PD: Voy a quitar la marca de [Solucionado], que ahora parece que ya no procede.
Back to top
View user's profile Send private message
papu
l33t
l33t


Joined: 25 Jan 2008
Posts: 707
Location: Sota algun pi o alzina...

PostPosted: Sat Apr 20, 2013 8:31 am    Post subject: Reply with quote

si se usa ntpc-client se ha de tener en cuenta esto
Code:
If you really need a quick time synchronization during boot, you can activate the ntp-client service, provided by net-misc/ntp.

As of net-misc/ntp-4.2.6_p5-r1, the Gentoo ntp-client service uses the deprecated ntpdate command (see the man page).
You can easily switch to the sntp command in the manner shown below. sntp works much faster (in a fraction of a second) than ntpdate (which takes a few seconds).
File: /etc/conf.d/ntp-client

# /etc/conf.d/ntp-client

# 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"
NTPCLIENT_CMD="sntp"


y aqui explican como como lanzar una cosa después de otra http://www.gentoo-wiki.info/HOWTO_NTP


asi que lo que hare sera poner el openrdate en el cron, yo tengo de sobras para sincronizar y no necesito ntp.


saludos, ad1
_________________
"~amd64" --cpu 7700 non-x --DDR5 2x16GB 6000MHz --gpu RX 470
Back to top
View user's profile Send private message
esteban_conde
Veteran
Veteran


Joined: 04 Jun 2003
Posts: 1670

PostPosted: Sat Apr 20, 2013 8:48 am    Post subject: Reply with quote

Efectivamente, para iniciar lo primero que hace es comprobar si hay conexion, caso de no haberla intenta crearla, caso de no poder lanza el mensaje de error y sale.
Como esto que aporto lo saco de dos trastos que tengo en casa puede que varíe con lo que tengas tu, ya habia pensado en que pasaría si no tubiese red y la respuesta es sencilla no se puede poner en default y en cuanto se tiene conexion se ejecuta /etc/init.d/ntp-client start, en circunstancias especiales se debe poner a mano la hora con date -s hh:mm:ss para evitar tener archivos en el futuro cuando se conecta correctamente.
Despues de puesta bién la hora a mano es el momento de hacer: hwclock --systohc para que la vez sigiente que arranques si no pone la hora correcta puedas restablecerla con hwclock --hctosys ya que puede llegarse al caso de que tanto hc como sys la tengan mal puesta.
_________________
Saludos a tod@s, Esteban.
Back to top
View user's profile Send private message
dalele
n00b
n00b


Joined: 17 Apr 2013
Posts: 6

PostPosted: Sat Apr 20, 2013 9:44 am    Post subject: Reply with quote

Bien, pues pongo la marca de solucionado y ya miraré cuál de las opciones utilizar.

Saludos a todos.
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