Bookworm timesyncd via DHCP

Einrichten des lokalen Netzes, Verbindung zu anderen Computern und Diensten.
Antworten
sys49152
Beiträge: 3
Registriert: 13.03.2024 18:41:32

Bookworm timesyncd via DHCP

Beitrag von sys49152 » 13.03.2024 19:05:53

Hallo zusammen,
auf meinem Bookworm System wird der timesyncd nicht im Bootprozess gestartet. Enabled ist der Service. Ich kann den Service von Hand starten.

Code: Alles auswählen

sudo systemctl start systemd-timesyncd.service
läuft.
In den Logdateien sehe ich keine Einträge während des Bootvorgangs.
meine /etc/systemd/timesyncd.conf sieht so aus:

Code: Alles auswählen

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it under the
#  terms of the GNU Lesser General Public License as published by the Free
#  Software Foundation; either version 2.1 of the License, or (at your option)
#  any later version.
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file, or by creating "drop-ins" in
# the timesyncd.conf.d/ subdirectory. The latter is generally recommended.
# Defaults can be restored by simply deleting this file and all drop-ins.
#
# See timesyncd.conf(5) for details.

[Time]
#NTP=
#FallbackNTP=0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org
#RootDistanceMaxSec=5
#PollIntervalMinSec=32
#PollIntervalMaxSec=2048
#ConnectionRetrySec=30
#SaveIntervalSec=60

Ich möchte das der timesyncd den Timeserver via DHCP bekommt. Muss der NTP Eintrag geändert werden?

TIA
Josef

mat6937
Beiträge: 2953
Registriert: 09.12.2014 10:44:00

Re: Bookworm timesyncd via DHCP

Beitrag von mat6937 » 13.03.2024 19:59:38

sys49152 hat geschrieben: ↑ zum Beitrag ↑
13.03.2024 19:05:53
auf meinem Bookworm System wird der timesyncd nicht im Bootprozess gestartet.
Wie sind die Ausgaben von:

Code: Alles auswählen

systemd-analyze blame | grep -i timesyncd
systemctl is-enabled systemd-timesyncd
timedatectl timesync-status
systemctl status systemd-timesyncd
timedatectl
?

sys49152
Beiträge: 3
Registriert: 13.03.2024 18:41:32

Re: Bookworm timesyncd via DHCP [gelöst]

Beitrag von sys49152 » 13.03.2024 21:07:37

Code: Alles auswählen

$ systemd-analyze blame | grep -i timesyncd
- keine Ausgabe -

Code: Alles auswählen

$ systemctl is-enabled systemd-timesyncd
enabled

Code: Alles auswählen

$ timedatectl timesync-status
       Server: n/a (192.168.178.1)
Poll interval: 0 (min: 32s; max 34min 8s)
 Packet count: 0

Code: Alles auswählen

$ systemctl status systemd-timesyncd
● systemd-timesyncd.service - Network Time Synchronization
     Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; preset: enabled)
    Drop-In: /etc/systemd/system/systemd-timesyncd.service.d
             └─override.conf
     Active: active (running) since Wed 2024-03-13 20:46:45 CET; 1min 35s ago
       Docs: man:systemd-timesyncd.service(8)
   Main PID: 1021 (systemd-timesyn)
     Status: "Contacted time server 192.168.178.1:123 (192.168.178.1)."
      Tasks: 2 (limit: 2315)
     Memory: 3.5M
        CPU: 23ms
     CGroup: /system.slice/systemd-timesyncd.service
             └─1021 /lib/systemd/systemd-timesyncd

Ich kann mir darauf keinen Reim machen. Es läuft.

Code: Alles auswählen

$ timedatectl
               Local time: Mi 2024-03-13 20:51:00 CET
           Universal time: Mi 2024-03-13 19:51:00 UTC
                 RTC time: Mi 2024-03-13 19:51:00
                Time zone: Europe/Berlin (CET, +0100)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no
Wahrscheinlich habe ich zuviel hin und her probiert. Ich hatte zuerst auch nur die Grundkonfig. Ich hatte systemd.networkd nachträglich eingeschaltet, ist wohl bei einer Standart Installation nicht an. Ich habe dann noch in /etc/systemd/network die Datei enp0s3.network angelegt. Inhalt:

Code: Alles auswählen

[Match]
Name=enp0s3

[Network]
DHCP=yes

Wenn es die Datei nicht gibt gibt es auch kein DHCP für das Ethernet Interface.
Vermutlich hat nur der letzte Reboot gefehlt der nun erfolgt ist.

Danke an mat6937 :hail:
Josef

Edit: Für mich gelöst.

mat6937
Beiträge: 2953
Registriert: 09.12.2014 10:44:00

Re: Bookworm timesyncd via DHCP [gelöst]

Beitrag von mat6937 » 13.03.2024 22:22:00

sys49152 hat geschrieben: ↑ zum Beitrag ↑
13.03.2024 21:07:37

Code: Alles auswählen

    Drop-In: /etc/systemd/system/systemd-timesyncd.service.d
             └─override.conf
Wie ist die Ausgabe von:

Code: Alles auswählen

cat /etc/systemd/system/systemd-timesyncd.service.d/override.conf
?

sys49152
Beiträge: 3
Registriert: 13.03.2024 18:41:32

Re: Bookworm timesyncd via DHCP

Beitrag von sys49152 » 13.03.2024 22:31:40

Code: Alles auswählen

$ cat /etc/systemd/system/systemd-timesyncd.service.d/override.conf 
[Service]
Environment=SYSTEMD_LOG_LEVEL=debug
Kann/sollte der Wert "runtergedreht" werden?

Antworten