[v2] systemd: Depend on network using Wants=/After=

Message ID 20261029161927.22896-1-valter.jansons@gmail.com
State Accepted
Headers
Series [v2] systemd: Depend on network using Wants=/After= |

Commit Message

Valters Jansons 29 Oct 2026, 4:19 p.m. UTC
Wants= is the recommended way to hook the start-up of one unit to the
start-up of another unit. We do not directly benefit from the stricter
Requires=.

Furthermore, we should be explicit and define an After= instead of
assuming the default dependencies ordering will be added.

Signed-off-by: Valters Jansons <valter.jansons@gmail.com>
---
Michael, thank you for the investigation.
Resubmitting the systemd change as suggested.

 src/systemd/location-update.service.in | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Patch

diff --git a/src/systemd/location-update.service.in b/src/systemd/location-update.service.in
index 50ba01f..e1b8b39 100644
--- a/src/systemd/location-update.service.in
+++ b/src/systemd/location-update.service.in
@@ -1,7 +1,8 @@ 
 [Unit]
 Description=Automatic Location Database Updater
 Documentation=man:location(1) https://man-pages.ipfire.org/libloc/location.html
-Requires=network.target
+Wants=network-online.target
+After=network-online.target
 
 [Service]
 Type=oneshot