NTPd Não Sincronizando em RaspberryPi

2

Como meu hardware (RasberryPi) não tem um relógio de hardware, cada inicialização nos de volta para a década de 1970, então eu uso o NTP. O gateway na rede em que estou fornece um serviço NTP-Server.

my /etc/ntp.conf parece com o follwing (linhas comentadas omitidas)

server 192.168.170.254 //gateway that hosts the service
driftfile /var/lib/ntp/ntp.drift

/etc/profile :

[connect wifi...]
timeout 15 ntpd -q -g //forces update so I have a time to work with, times out so I don't get a total hang if it doesn't work
systemctl start ntpd.service //in hopes that I will work at some point and to keep it in sync
date //see if it worked
[start main program...]

Estou sentindo falta de algo?

Editar
Saída de ntpd -q :

DEC 31 17:00:43 alarmpi ntpd[349]: ntpd [email protected] Wed Jul  2 03:23:39 UTC 2014 (1): Starting
DEC 31 17:00:43 alarmpi ntpd[349]: Command line: /usr/bin/ntpd -q
DEC 31 17:00:43 alarmpi ntpd[349]: proto: precision = 3000 usec (-18)
DEC 31 17:00:43 alarmpi ntpd[349]: Listen and drop on 0 v4wildcard 0.0.0.0:123
DEC 31 17:00:43 alarmpi ntpd[349]: Listen normally on 1 lo 127.0.0.1:123
DEC 31 17:00:43 alarmpi ntpd[349]: Listen normally on 2 wlan0 192.168.170.100:123
DEC 31 17:00:43 alarmpi ntpd[349]: Listening on routing socket on fd #19 for interface updates
#hangs here till interrupted

Saída de systemctl status ntpd :

* ntpd.service - Network Time Service
Loaded: loaded (/usr/lib/systemd/system/ntpd.service; disabled)
Active: active (running) since Wed 1969-12-31 17:00:43 MST, 16s ago
Process: 332 ExecStart=/usr/bin/ntpd -g -u ntp:ntp -p /run/ntpd.pid (code=exited, status=0/SUCCESS)
Main PID: 335 (ntpd)
CGroup: /system.slice/ntpd.service
        '-335 /usr/bin/ntpd -g -u ntp:ntp -p /run/ntpd.pid

DEC 31 17:00:43 alarmpi ntpd[332]: ntpd [email protected] Wed Jul  2 03:23:39 UTC 2014 (1): Starting
DEC 31 17:00:43 alarmpi ntpd[332]: Command line: /usr/bin/ntpd -g -u ntp:ntp -q /run/ntpd.pid
DEC 31 17:00:43 alarmpi systemd[1]: PID file /run/ntpd.pid not readable (yet?) after start.
DEC 31 17:00:43 alarmpi ntpd[335]: proto: precision = 3000 usec (-18)
DEC 31 17:00:43 alarmpi ntpd[335]: Listen and drop on 0 v4wildcard 0.0.0.0:123
DEC 31 17:00:43 alarmpi ntpd[335]: Listen normally on 1 lo 127.0.0.1:123
DEC 31 17:00:43 alarmpi ntpd[335]: Listen normally on 2 wlan0 192.168.170.100:123
DEC 31 17:00:43 alarmpi ntpd[335]: Listening on routing socket on fd #19 for interface updates
DEC 31 17:00:43 alarmpi systemd[1]: Started Network Time Service
    
por Mark 01.08.2014 / 14:09

1 resposta

1

A resposta do @ asonwryan para outra pergunta fornece uma boa solução para esse problema. Problemas de hardware (falta de relógio em tempo real) tornam isso um pouco difícil.

Give the RaspberryPi's lack of a RTC, I would suggest that you ensure that you use a tool that can store the last time to disk and then references that at boot time to pull the clock out of the dawn of UNIX time.

Using a combination of systemd-timesyncd, with an optional configuration file for your preferred time servers in /etc/systemd/timesyncd.conf, and systemd-networkd will bring your network up swiftly at boot and correct any drift in your clock as early as practicably possible. The daemon will then sync your clock at periodic intervals (around every 30 minutes).

    
por 11.05.2015 / 03:39