In een notendop:
pi@ph5b:~ $ lsb_release -d
Description: Raspbian GNU/Linux 11 (bullseye)
pi@ph5b:~ $ systemctl is-enabled systemd-timesyncd.service
enabled
pi@ph5a:~ $ lsb_release -d
Description: Raspbian GNU/Linux 10 (buster)
pi@ph5a:~ $ systemctl is-enabled systemd-timesyncd.service
enabled
dehakkelaar@vm:~$ lsb_release -d
Description: Debian GNU/Linux 9.12 (stretch)
dehakkelaar@vm:~$ systemctl is-enabled systemd-timesyncd.service
enabled
Sommige distro's willen deze nog wel eens vervangen door
chrony of
ntpd omdat deze naast de client functie ook als NTP server kan functioneren wat bij
systemd-timesyncd.service ontbreekt.
Het is ook een apparte package los van
systemd:
pi@ph5b:~ $ dpkg -S systemd-timesyncd.service
systemd-timesyncd: /usr/share/man/man8/systemd-timesyncd.service.8.gz
systemd-timesyncd: /lib/systemd/system/systemd-timesyncd.service
Ik geloof dat als je
ntpd of
chrony installeert, dan masken ze de
systemd-timesyncd.service unit als deze ook is geinstalleerd.
Ik weet dit niet 100% zeker maar heb dit masken wel vaker gezien in andere fora mbt
ntpd en
chrony:
pi@ph5b:~ $ man systemctl
[..]
mask UNIT...
Mask one or more units, as specified on the command line. This
will link these unit files to /dev/null, making it impossible
to start them. This is a stronger version of disable, since it
prohibits all kinds of activation of the unit, including
enablement and manual activation. Use this option with care.
This honors the --runtime option to only mask temporarily until
the next reboot of the system. The --now option may be used to
ensure that the units are also stopped. This command expects
valid unit names only, it does not accept unit file paths.
Datum/tijd en ofdat NTP "active" is en synced:
pi@ph5b:~ $ timedatectl status
Local time: Tue 2022-09-27 19:24:19 CEST
Universal time: Tue 2022-09-27 17:24:19 UTC
RTC time: n/a
Time zone: Europe/Amsterdam (CEST, +0200)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
Details mbt het syncen:
pi@ph5b:~ $ timedatectl timesync-status
Server: 5.79.75.37 (2.debian.pool.ntp.org)
Poll interval: 34min 8s (min: 32s; max 34min 8s)
Leap: normal
Version: 4
Stratum: 2
Reference: A18F188D
Precision: 1us (-23)
Root distance: 33.164ms (max: 5s)
Offset: +181us
Delay: 12.502ms
Jitter: 1.784ms
Packet count: 663
Frequency: -17.921ppm
De
systemd journals logt ook meldingen:
pi@ph5b:~ $ journalctl --full --no-pager -u systemd-timesyncd.service
[..]
Sep 12 04:58:08 ph5b systemd[1]: Started Network Time Synchronization.
Sep 12 05:12:42 ph5b systemd-timesyncd[201]: Initial synchronization to time server 5.79.75.37:123 (2.debian.pool.ntp.org).
De "fake HW clock" is deze:
pi@ph5b:~ $ systemctl list-units "*fake*"
UNIT LOAD ACTIVE SUB DESCRIPTION
fake-hwclock.service loaded active exited Restore / save the current clock
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
1 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
pi@ph5b:~ $ man fake-hwclock
[..]
BACKGROUND
Many embedded Linux systems do not have a functional hardware
clock. Either they simply don't have a hardware clock at all or
they have a hardware clock but it is not usable (e.g. because Linux
doesn't know how to use it or because no battery is present).
This can lead to time moving backwards to some default value (often
1970) when the system is rebooted. Since lots of software assumes
that time only moves forward this is a bad thing. NTP can (and
should where practical) be used to sync with an external timeserver
but it is not available early in the boot process and may be un‐
available for other reasons.
The design expectation of fake-hwclock is that it will be run very
late at shutdown and very early at boot. This will ensure that fsck
has a vaguely sensible idea of system time at boot and won't com‐
plain that the last-modified time in the filesystem is not hugely
in the past or future. Some users may not worry about this too use
case, in which case it is possible to modify the init system con‐
figuration to move things earlier/later as appropriate.
DESCRIPTION
fake-hwclock sets and queries a fake "hardware clock" which stores
the time in a file. This program may be run by the system adminis‐
trator directly but is typically run by init (to load the time on
startup and save it on shutdown) and cron (to save the time
hourly).
If no command is given then fake-hwclock acts as if the save com‐
mand was used.
EDIT: Ow was deze vergeten:
pi@ph5b:~ $ cat /etc/cron.hourly/fake-hwclock
#!/bin/sh
#
# Simple cron script - save the current clock periodically in case of
# a power failure or other crash
if (command -v fake-hwclock >/dev/null 2>&1) ; then
fake-hwclock save
fi
En waar @
Freee!! naar refereert is de kip of het ei dilemma:
Wikipedia: Kip-en-eiprobleem
De NTP daemon is namelijk afhankelijk van juiste DNS resolutie van de NTP server domeinnamen.
En de DNS daemon is weer afhankelijk van de juiste tijd als DNSSEC wordt gebruikt zoals bv in de officiele Pi-hole Unbound gids.
Boel info hieronder mbt Pi-hole:
https://discourse.pi-hole...pi-hole-not-working/53805
There are only 10 types of people in the world: those who understand binary, and those who don't