Raspberry pi - ntp - syslog
#1
Tue, 2018-02-27 11:44
mickesommar
-
- Offline
- 3 weeks 5 days ago
- 2018-02-27
Hi
I have installed the raspberry pi image. On two differens pi:s. I use "in memory"-installation.
I have tried both chrony and busybox ntp clients. The time will be updated during a boot.
The problem is that /var/log/messages will use old-unix-time. So all the logs will have the same timestamp.
I have tried to rebood the klogd daemon, it fails. But I can se the correct time-stamp in the /var/log/messages then the daemon is rebooted.
But it will go back to old-unix-time-stamp.
Any ideas?
// Micke
Hi All
I have not find a solution yet, but a "workaround".
The syslogd-daemon is implemented in busybox. The ntpd-daemon is alos implemented in busybox.
But the syslogd get the wrong time (old unix-time), even if the ntp-client get the correct time in "userland".
The alpine-developer had to create a patch to prevent to get the wrong time-format from "userland":
https://git.alpinelinux.org/cgit/aports/tree/main/busybox/0009-sysklogd-add-Z-option-to-adjust-message-timezones.patcha
The patch will add a -Z flag to syslogd. This flag will try to get the time from the "localtime" insdeed. This is a problem with the Raspberry Pi (RPI).
The RPI does not have a "hardware clock", so I think it is a bug in the -Z implemantation for RPI:s.
I'm living in Sweden, we have timezone "Europe/Stockholm" (+01).
My workaround is to change timezone to UTC in userland, and remove the -Z flag in /etc/config.d/syslog .
The time in userland will be UTC, but also in all the log-files. I can live with one hour off, better then the same time-stamp on all log-entrys.
// Micke