Resolvendo o problema com o Relógio no Arch Linux!

2 mar

 


Ao ligar meu notebook Compaq Presário CQ40 percebia que o relógio estava sempre atrasando uns minutos. Ao acertar o relógio tudo funcionava perfeitamente, mas quando deixava o note um tempo desligado o relógio atrasava novamente. Verifiquei a configuração no rc.conf:

HARDWARECLOCK=”localtime”

TIMEZONE=”America/Sao_Paulo”

Aparentemente estava tudo certo.

Cogitei a troca da bateria da placa mãe, mas um detalhe me fazia ter certeza que o problema não era esse já que no Ubuntu por exemplo o mesmo erro não acontecia.

Depois de muita pesquisa e várias tentativas frustradas acho que identifiquei o provável problema.

Existe um arquivo em “var/lib/hwclock” chamado Adjtime, acredito que ele possa ser o causador de toda essa dor de cabeça!

Ao remover o arquivo o relógio voltou a funcionar perfeitamente, mas como já tinha feito tanta coisa não tenho certeza absoluta de ser essa a solução definitiva do problema.

-Para quem quiser tentar:

#rm /var/lib/hwclock/adjtime

Também fiz a instalação/configuração do NTP.

-Instalando:

#pacman -S ntp

-Editando o ntp.conf:

#nano /etc/ntp.conf

Deixe-o dessa maneira:

# 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 pool.ntp.org
#server br.pool.ntp.org
server 2.br.pool.ntp.org
server 1.south-america.pool.ntp.org
server 0.south-america.pool.ntp.org

##
# 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
##

#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.

# A default deny all (including localhost) policy
# To use this define restrictions for all servers and clients
#restrict default ignore
#restrict -6 default ignore

# A more open policy, allow access but deny changing the configuration
restrict default nomodify nopeer
#restrict -6 default nomodify nopeer

# Allow localhost
restrict 127.0.0.1
#restrict -6 ::1

# 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.0.0 mask 255.255.255.0 nomodify nopeer notrap

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

________________________________________

-Se estiver usando o NetworkManager instale também esse pacote:

#pacman -S networkmanager-dispatcher-ntpd

-Feito isso vamos editar o rc.conf:

#nano /etc/rc.conf

Adicione “@ntpd” aos Daemons.

Obs.: É importante adicioná-lo após o NetworkManager/Wicd e remover o hwclock dos daemons.

Rode um “/etc/rc.d/ntpd start” para iniciar o serviço e pronto.

Espero que funcione com todos!

Meus agradecimentos ao meu amigo Douglas pela ajuda com o NTP.

Grande abraço!

Resolvendo problema com o Relógio no Arch Linux!

Ao ligar meu notebook Compaq Presário CQ40 percebia que o relógio estava sempre atrasando uns minutos. Ao acertar o relógio tudo funcionava perfeitamente, mas quando deixava o note um tempo desligado o relógio atrasava novamente. Verifiquei a configuração no rc.conf:

HARDWARECLOCK=”localtime”

TIMEZONE=”America/Sao_Paulo”

Aparentemente estava tudo certo.

Cogitei a troca da bateria da placa mãe, mas um detalhe me fazia ter certeza que o problema não era esse já que no Ubuntu por exemplo o mesmo erro não acontecia.

Depois de muita pesquisa e várias tentativas frustradas acho que identifiquei o provável problema.

Existe um arquivo em “var/lib/hwclock” chamado Adjtime, acredito que ele possa ser o causador de toda essa dor de cabeça!

Ao remover o arquivo o relógio voltou a funcionar perfeitamente, mas como já tinha feito tanta coisa não tenho certeza absoluta de ser essa a solução definitiva do problema.

-Para quem quiser tentar:

#rm /var/lib/hwclock/adjtime

Também fiz a instalação/configuração do NTP.

-Instalando:

#pacman -S ntp

-Editando o ntp.conf:

#nano /etc/ntp.conf

Deixe-o dessa maneira:

# 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 pool.ntp.org

#server br.pool.ntp.org

server 2.br.pool.ntp.org

server 1.south-america.pool.ntp.org

server 0.south-america.pool.ntp.org

##

# 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

##

#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.

# A default deny all (including localhost) policy

# To use this define restrictions for all servers and clients

#restrict default ignore

#restrict -6 default ignore

# A more open policy, allow access but deny changing the configuration

restrict default nomodify nopeer

#restrict -6 default nomodify nopeer

# Allow localhost

restrict 127.0.0.1

#restrict -6 ::1

# 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.0.0 mask 255.255.255.0 nomodify nopeer notrap

# you should not need to modify the following paths

driftfile /var/lib/ntp/ntp.drift

-Se estiver usando o NetworkManager instale também esse pacote:

#pacman -S networkmanager-dispatcher-ntpd

-Feito isso vamos editar o “rc.conf”:

#nano /etc/rc.conf

Adicione “@ntpd” aos Daemons.

Obs.: É importante adicioná-lo após o NetworkManager/Wicd.

Rode um “/etc/rc.d/ntpd start” para iniciar o serviço e pronto.

Espero que funcione com todos!

Grande abraço!

One Reply to “Resolvendo o problema com o Relógio no Arch Linux!”

Deixe um comentário para David Cancelar resposta

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

Esse site utiliza o Akismet para reduzir spam. Aprenda como seus dados de comentários são processados.