-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Relocate HAOS Systemd drop-ins to /usr/lib/systemd (#3582)
* Relocate HAOS Systemd drop-ins to /usr/lib/systemd With some exceptions, Systemd drop-ins overriding default unit configuration have been placed to `/etc/systemd/system`. This is meant for user overrides of those, or per `man 5 systemd.unit` for "system unites created by the administrator". Relocate all of these to `/usr/lib/systemd` which should be used as path for units "installed by the distribution package manager" which is closer to what we're trying to achieve. This will make it easier to detect changes to unit files once we enable the possibility to edit the content of /etc. * Patch systemd-timesyncd.service instead of replacing it fully
- Loading branch information
Showing
21 changed files
with
41 additions
and
61 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
...-external/patches/systemd/0003-systemd-timesyncd-delay-start-after-network-online.t.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
From 13cf1bb9c5fa91762184c3b0dddea1328c2746bc Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Jan=20=C4=8Cerm=C3=A1k?= <[email protected]> | ||
Date: Wed, 11 Sep 2024 17:25:00 +0200 | ||
Subject: [PATCH] systemd-timesyncd: delay start after network-online.target | ||
|
||
As explained in [1], it's desired for the systemd-timesyncd to run after | ||
the network is deemed online, otherwise the connectivity (at least on | ||
HAOS with NetworkManager) is not operational when the NTP sync is | ||
attempted and it fails, delaying the boot and leading to other problems. | ||
Because it's not possible to remove dependencies of existing units using | ||
drop-ins, patch the service template file for systemd-timesyncd unit | ||
instead, avoiding the need for complete unit file override as in [2]. | ||
|
||
[1] https://github.com/home-assistant/operating-system/pull/2068 | ||
[2] https://github.com/home-assistant/operating-system/pull/2082 | ||
--- | ||
units/systemd-timesyncd.service.in | 6 +++--- | ||
1 file changed, 3 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/units/systemd-timesyncd.service.in b/units/systemd-timesyncd.service.in | ||
index c606461..5870744 100644 | ||
--- a/units/systemd-timesyncd.service.in | ||
+++ b/units/systemd-timesyncd.service.in | ||
@@ -13,8 +13,8 @@ Documentation=man:systemd-timesyncd.service(8) | ||
ConditionCapability=CAP_SYS_TIME | ||
ConditionVirtualization=!container | ||
DefaultDependencies=no | ||
-After=systemd-sysusers.service | ||
-Before=time-set.target sysinit.target shutdown.target | ||
+After=systemd-sysusers.service network-online.target | ||
+Before=time-set.target shutdown.target | ||
Conflicts=shutdown.target | ||
Wants=time-set.target | ||
|
||
@@ -56,5 +56,5 @@ User=systemd-timesync | ||
{{SERVICE_WATCHDOG}} | ||
|
||
[Install] | ||
-WantedBy=sysinit.target | ||
+WantedBy=time-sync.target | ||
Alias=dbus-org.freedesktop.timesync1.service |
60 changes: 0 additions & 60 deletions
60
buildroot-external/rootfs-overlay/etc/systemd/system/systemd-timesyncd.service
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion
1
...m/systemd-timesyncd.service.d/hassos.conf → ...m/systemd-timesyncd.service.d/hassos.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
[Unit] | ||
RequiresMountsFor=/var/lib/systemd | ||
After=network-online.target |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.