From 7df65e832e4b15fd7ae2af8c5b967f845323d30b Mon Sep 17 00:00:00 2001 From: Matthew Johnson Date: Wed, 16 Feb 2022 00:56:14 -0800 Subject: [PATCH] Relax systemd requirements (#1368) * [configs] Remove requires systemd-networkd dep from smfd service The smf no longer has (never had?) a dependency on systemd-networkd, and can start and remain operational without systemd-networkd specifically running. * [configs] Relax upf dependency on systemd-networkd The upf relies on systemd-networkd to create the ogstun interface, but does not communicate with it at runtime. It currently has a "Requires" dependency specified, which means that the upf will be stopped if systemd-networkd is ever stopped. Since the upf doesn't actually care if systemd-networkd is later stopped after ogstun is created, it can use the weaker "Wants" dependency type, which allows it to keep running even if systemd-networkd were to be stopped. Regardless, since it does rely on systemd-networkd specifically to create the ogstun interface, it should sequence itself "After" systemd-networkd has been started. Since the true dependency is ogstun, not systemd-networkd, a cleaner approach would depend on the specific tunnel device being available. Systemd exposes this information via device units, but I'm not sure if they are always consistently named across platforms. --- configs/systemd/open5gs-smfd.service.in | 1 - configs/systemd/open5gs-upfd.service.in | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/configs/systemd/open5gs-smfd.service.in b/configs/systemd/open5gs-smfd.service.in index a4d5c2fc1..7f8f151dc 100644 --- a/configs/systemd/open5gs-smfd.service.in +++ b/configs/systemd/open5gs-smfd.service.in @@ -1,7 +1,6 @@ [Unit] Description=Open5GS SMF Daemon After=network-online.target -Requires=systemd-networkd.service [Service] Type=simple diff --git a/configs/systemd/open5gs-upfd.service.in b/configs/systemd/open5gs-upfd.service.in index b9bf0f1b5..3e409e7df 100644 --- a/configs/systemd/open5gs-upfd.service.in +++ b/configs/systemd/open5gs-upfd.service.in @@ -1,7 +1,7 @@ [Unit] Description=Open5GS UPF Daemon -After=network-online.target -Requires=systemd-networkd.service +After=network-online.target systemd-networkd.service +Wants=systemd-networkd.service [Service] Type=simple