Probleme mit der Uhrzeit auf dem Pi

Begonnen von jensdipo, 22 Juni 2017, 19:43:33

Vorheriges Thema - Nächstes Thema

jensdipo

Hallo Otto,
hier die Ausgabe:
root@raspberrypi:/home/pi# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
ns2.customer-re .INIT.          16 u    - 1024    0    0.000    0.000   0.000
stratum2-4.NTP. .INIT.          16 u    - 1024    0    0.000    0.000   0.000
epsilon.h6g-ser .INIT.          16 u    - 1024    0    0.000    0.000   0.000
195.50.171.101  .INIT.          16 u    - 1024    0    0.000    0.000   0.000
MFG
Jens


Otto123

Hallo Jens,

die Ausgabe kann ich nicht deuten, kommt mir komisch vor. Sieht so aus als kann er niemanden ereichen. Der Pi darf schon ins Internet - oder?

Vielleicht musst Du mal den Pi neu starten.

Nimm bitte Codetags für die Ausgaben, da kann man besser lesen -> die # Taste über dem  :-X

Gruß Otto
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

LuckyDay

@jensdipo
Ich habe dir mal meine Ausgabe vom Pi kopiert , wie es aussehen sollte (Jessi lite)
Ich lese hier auch gerade interresiert mit

pi@raspberrypi:~ $ sudo systemctl -l status ntp
● ntp.service - LSB: Start NTP daemon
   Loaded: loaded (/etc/init.d/ntp)
   Active: active (running) since Di 2017-05-30 15:27:02 CEST; 3 weeks 3 days ago
  Process: 545 ExecStart=/etc/init.d/ntp start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/ntp.service
           └─561 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -c /var/lib/ntp/ntp.conf.dhcp -u 106:111

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
pi@raspberrypi:~ $ ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+ns.km33237.keym 192.53.103.108   2 u  826 1024  377   23.437    1.212   1.344
-kotschak.de     129.70.132.37    3 u  430 1024  377   22.837   -1.766  52.478
*public.trexler. 234.177.159.184  2 u  634 1024  377   23.217    1.629   0.686
+ns.heikorichter 192.53.103.103   2 u  576 1024  377   21.267   -2.280   1.347
-fritz.box       138.201.20.231   3 u  959 1024  377    0.636   -1.751   0.686
pi@raspberrypi:~ $

pi@raspberrypi:~ $ date
Sa 24. Jun 14:57:34 CEST 2017

jensdipo

Hallo Otto,
habe in der /etc/apt/sources.list den Eintrag für Fhem rausgenommen.
Danach mit sudo apt-get update && sudo apt-get -y upgrade && sudo reboot ein Update durchgeführt und es kommen jetzt keine Fehlermeldungen mehr.
Leider sieht die Ausgabe nicht anders aus:
pi@raspberrypi:~ $ ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
stratum2-1.NTP. .INIT.          16 u    -   64    0    0.000    0.000   0.000
umbrella.co.ua  .INIT.          16 u    -   64    0    0.000    0.000   0.000
ntp2.ig-haase.d .INIT.          16 u    -   64    0    0.000    0.000   0.000
formularfetisch .INIT.          16 u    -   64    0    0.000    0.000   0.000

Auch diese ist immer noch die gleiche:
pi@raspberrypi:~ $ sudo systemctl -l status ntp
● ntp.service - LSB: Start NTP daemon
   Loaded: loaded (/etc/init.d/ntp)
   Active: active (running) since Sun 2017-06-25 09:15:17 CEST; 2min 0s ago
  Process: 804 ExecStart=/etc/init.d/ntp start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/ntp.service
           └─826 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 106:111

Jun 25 09:15:17 raspberrypi ntpd[826]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
Jun 25 09:15:17 raspberrypi ntpd[826]: Listen and drop on 1 v6wildcard :: UDP 123
Jun 25 09:15:17 raspberrypi ntpd[826]: Listen normally on 2 lo 127.0.0.1 UDP 123
Jun 25 09:15:17 raspberrypi ntpd[826]: Listen normally on 3 eth0 192.168.129.110 UDP 123
Jun 25 09:15:17 raspberrypi ntpd[826]: Listen normally on 4 eth0 fe80::5780:1ff0:9779:eec0 UDP 123
Jun 25 09:15:17 raspberrypi ntpd[826]: Listen normally on 5 lo ::1 UDP 123
Jun 25 09:15:17 raspberrypi ntpd[826]: peers refreshed
Jun 25 09:15:17 raspberrypi ntpd[826]: Listening on routing socket on fd #22 for interface updates
Jun 25 09:15:17 raspberrypi systemd[1]: Started LSB: Start NTP daemon.
Jun 25 09:15:17 raspberrypi ntp[804]: Starting NTP server: ntpd.

Ins Internet kommt der Pi und von Extern kann ich auch ganz normal zugreifen:
pi@raspberrypi:~ $ ping google.de
PING google.de (216.58.206.3) 56(84) bytes of data.
64 bytes from fra16s20-in-f3.1e100.net (216.58.206.3): icmp_seq=1 ttl=54 time=16.8 ms
64 bytes from fra16s20-in-f3.1e100.net (216.58.206.3): icmp_seq=2 ttl=54 time=15.2 ms
64 bytes from fra16s20-in-f3.1e100.net (216.58.206.3): icmp_seq=3 ttl=54 time=16.4 ms

Noch eine Idee was es sein kann?
MFG
Jens

Otto123

#19
Moin,

ich denke der Start vom ntp sieht eigentlich gut aus. Aber er erreicht die Zeitserver nicht?
Geht ping 0.debian.pool.ntp.org?

Versuch mal ntpd -q -g

Gruß Otto
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

jensdipo

Moin,
Funktioniert:
pi@raspberrypi:~ $ ping 0.debian.pool.ntp.org
PING 0.debian.pool.ntp.org (37.120.184.82) 56(84) bytes of data.
64 bytes from mail.morbitzer.de (37.120.184.82): icmp_seq=1 ttl=56 time=18.0 ms
64 bytes from mail.morbitzer.de (37.120.184.82): icmp_seq=2 ttl=56 time=19.2 ms
64 bytes from mail.morbitzer.de (37.120.184.82): icmp_seq=3 ttl=56 time=19.5 ms
^C
--- 0.debian.pool.ntp.org ping statistics ---
4 packets transmitted, 3 received, 25% packet loss, time 3004ms
rtt min/avg/max/mdev = 18.092/18.987/19.574/0.662 ms

Allerdings ntp kennt er nicht:
pi@raspberrypi:~ $ ntp -q -g
-bash: ntp: command not found
pi@raspberrypi:~ $ sudo ntp -q -g
sudo: ntp: command not found
pi@raspberrypi:~ $ sudo ntpq -q -g
/usr/bin/ntpq: illegal option -- q
ntpq - standard NTP query program - Ver. 4.2.6p5
USAGE:  ntpq [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]
(AutoOpts bug):  could not locate the 'help' option.

MFG
Jens

Otto123

Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

jensdipo

Hy Otto,
danach kommt keine Ausgabe.
ntpq -d und systemctl -l status ntpergibt immer noch das selbe wie vorher auch.
MFG
Jens

Otto123

letzter Versuch von mir:systemctl stop ntp
sudo ntpd -q -g -x -n
systemctl start ntp


Ich befürchte, Du hast Dein System irgendwo verbogen. Du musst durchgehen, was Du nach dem Aufspielen des raspbian jessie lite alles gemacht hast. Im Original geht das ohne Probleme. Das es bei Dir keinen ntp gab, sagt mir Du hast Teile des Systems entfernt.

Gruß Otto
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

Wernieman

@Otto,

wenn Du ein paar Veiträge vorher liest:
23 Jun 13:01:49 ntpdate[15505]: bind() fails: Permission denied
Entweder hat er den Befehl nicht wie gewünscht als root ausgeführt, oder es stimmt etwas grundsätzliches Nicht.

@jensdipo
Gib es mal Deine ntp.configuration, am besten ohne Kommentarzeilen:
grep -v "^#" /etc/ntp.conf

Und was die Logfiles sagen:
grep ntp /var/log/syslog
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Otto123

Zitat von: Wernieman am 25 Juni 2017, 21:46:26
@Otto,

wenn Du ein paar Veiträge vorher liest:
23 Jun 13:01:49 ntpdate[15505]: bind() fails: Permission denied
Entweder hat er den Befehl nicht wie gewünscht als root ausgeführt, oder es stimmt etwas grundsätzliches Nicht.
Hab ich gelesen und genau der Meinung bin ich. Es stimmt grundlegend etwas nicht!
Der Befehl ntpdate gilt als deprecated und ist in raspbian Jessi nicht vorhanden ( ich habe 4 Systeme mit unterschiedlichen Jessi Stand)
Alle meine Systeme haben ntp out of the box installiert und laufend. Bei ihm ist ntp nicht vorhanden.  :-[
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

Wernieman

"ntp" nicht vorhanden ist nicht so schlimm. Das ntpdate "depricatet" und normalerweise nicht installiert auch nicht. ntpdate und ntp verwenden das gleiche Protokoll, deshalb ist mir mittlerweile eingefallen:

- Läuft eine "Firewall"?
iptables -L
- Blockiert irgendetwas anderes den Port
netstat -lntp

Bitte alle Befehle als root ausführen, oder mit "sudo"
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Hollo

Zitat von: Wernieman am 26 Juni 2017, 08:08:36
...
- Läuft eine "Firewall"?
...
Ja, hat er, hat ja eine pfsense davor.

FHEM 6.x auf RPi 3B Buster
Protokolle: Homematic, Z-Wave, MQTT, Modbus
Temp/Feuchte: JeeLink-Clone und LGW mit LaCrosse/IT
sonstiges: Linux-Server, Dreambox, "RSS-Tablet"

Wernieman

Firewall auf dem Pi .. nicht eine im Netz .. ;o)
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

jensdipo

Hallo Zusammen,
und als erstes noch mal vielen Dank für euer bemühen.
Hier mal ntp.conf:
driftfile /var/lib/ntp/ntp.drift
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable

server 0.debian.pool.ntp.org iburst
server 1.debian.pool.ntp.org iburst
server 2.debian.pool.ntp.org iburst
server 3.debian.pool.ntp.org iburst

restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery

restrict 127.0.0.1
restrict ::1

Hier das Syslog:
Jun 26 12:00:01 raspberrypi CRON[27494]: (pi) CMD (ntpdate -s 0.de.pool.ntp.org)
Jun 26 18:00:01 raspberrypi CRON[17990]: (pi) CMD (ntpdate -s 0.de.pool.ntp.org)

Die iptables:
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Und noch Netstat:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:2121            0.0.0.0:*               LISTEN      846/owhttpd
tcp        0      0 0.0.0.0:4304            0.0.0.0:*               LISTEN      834/owserver
tcp        0      0 0.0.0.0:8083            0.0.0.0:*               LISTEN      632/perl
tcp        0      0 0.0.0.0:8084            0.0.0.0:*               LISTEN      632/perl
tcp        0      0 0.0.0.0:8085            0.0.0.0:*               LISTEN      632/perl
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      805/sshd
tcp        0      0 0.0.0.0:6720            0.0.0.0:*               LISTEN      1107/eibd
tcp        0      0 0.0.0.0:7072            0.0.0.0:*               LISTEN      632/perl
tcp        0      0 0.0.0.0:2120            0.0.0.0:*               LISTEN      845/owftpd
tcp6       0      0 :::22                   :::*                    LISTEN      805/sshd

Wenn ich auf dem Pi eine Firewall habe dann unbewust.
MFG
Jens