From c0ffe1ffe4fdbacc698b48a22b07bac2ca1c213e Mon Sep 17 00:00:00 2001 From: Matthew Johnson Date: Tue, 15 Feb 2022 05:33:33 -0800 Subject: [PATCH] Systemd sequencing (#1366) * [configs] Do not require ogstun for system online Systemd-networkd will wait for all managed interfaces to be configured before determining the system is online. Since the ogstun and upf are more logically an application rather than a system networking service, don't wait for them to be configured by default. This breaks the circular dependency between the userspace cellular core network services and the system's network, which will allow the cellular core network services to sequence themselves cleanly after the system's network is up and configured. * [configs] Sequence network-dependent units after network-online Since open5gs targets platforms with both ifupdown (debian) and systemd-networkd (Ubuntu) as core networking providers, this commit sequences network-dependent core network components after the generic network-online.target instead of one of the specific provider targets. This allows the core network to operate correctly with both systemd-networkd and ifupdown (networking), and fixes the issue observed in https://github.com/open5gs/open5gs/issues/826 where some platforms may fail to start cleanly. --- configs/systemd/99-open5gs.network | 3 +++ configs/systemd/open5gs-amfd.service.in | 2 +- configs/systemd/open5gs-ausfd.service.in | 2 +- configs/systemd/open5gs-mmed.service.in | 2 +- configs/systemd/open5gs-nssfd.service.in | 2 +- configs/systemd/open5gs-sgwcd.service.in | 2 +- configs/systemd/open5gs-sgwud.service.in | 2 +- configs/systemd/open5gs-smfd.service.in | 2 +- configs/systemd/open5gs-udmd.service.in | 2 +- configs/systemd/open5gs-upfd.service.in | 2 +- 10 files changed, 12 insertions(+), 9 deletions(-) diff --git a/configs/systemd/99-open5gs.network b/configs/systemd/99-open5gs.network index 91af89d30..572405c3b 100644 --- a/configs/systemd/99-open5gs.network +++ b/configs/systemd/99-open5gs.network @@ -4,3 +4,6 @@ Name=ogstun [Network] Address=10.45.0.1/16 Address=2001:db8:cafe::1/48 + +[Link] +RequiredForOnline=false diff --git a/configs/systemd/open5gs-amfd.service.in b/configs/systemd/open5gs-amfd.service.in index d9280bc9c..3ba5ed93a 100644 --- a/configs/systemd/open5gs-amfd.service.in +++ b/configs/systemd/open5gs-amfd.service.in @@ -1,6 +1,6 @@ [Unit] Description=Open5GS AMF Daemon -After=networking.service +After=network-online.target [Service] Type=simple diff --git a/configs/systemd/open5gs-ausfd.service.in b/configs/systemd/open5gs-ausfd.service.in index f633eb2ef..147430e90 100644 --- a/configs/systemd/open5gs-ausfd.service.in +++ b/configs/systemd/open5gs-ausfd.service.in @@ -1,6 +1,6 @@ [Unit] Description=Open5GS AUSF Daemon -After=networking.service +After=network-online.target [Service] Type=simple diff --git a/configs/systemd/open5gs-mmed.service.in b/configs/systemd/open5gs-mmed.service.in index 63d79e196..3508f6c00 100644 --- a/configs/systemd/open5gs-mmed.service.in +++ b/configs/systemd/open5gs-mmed.service.in @@ -1,6 +1,6 @@ [Unit] Description=Open5GS MME Daemon -After=networking.service +After=network-online.target [Service] Type=simple diff --git a/configs/systemd/open5gs-nssfd.service.in b/configs/systemd/open5gs-nssfd.service.in index 1d03925a2..4d78887ee 100644 --- a/configs/systemd/open5gs-nssfd.service.in +++ b/configs/systemd/open5gs-nssfd.service.in @@ -1,6 +1,6 @@ [Unit] Description=Open5GS NSSF Daemon -After=networking.service +After=network-online.target [Service] Type=simple diff --git a/configs/systemd/open5gs-sgwcd.service.in b/configs/systemd/open5gs-sgwcd.service.in index 75f03819b..00ab2f629 100644 --- a/configs/systemd/open5gs-sgwcd.service.in +++ b/configs/systemd/open5gs-sgwcd.service.in @@ -1,6 +1,6 @@ [Unit] Description=Open5GS SGW-C Daemon -After=networking.service +After=network-online.target [Service] Type=simple diff --git a/configs/systemd/open5gs-sgwud.service.in b/configs/systemd/open5gs-sgwud.service.in index c4cc78f45..ce2720fb6 100644 --- a/configs/systemd/open5gs-sgwud.service.in +++ b/configs/systemd/open5gs-sgwud.service.in @@ -1,6 +1,6 @@ [Unit] Description=Open5GS SGW-U Daemon -After=networking.service +After=network-online.target [Service] Type=simple diff --git a/configs/systemd/open5gs-smfd.service.in b/configs/systemd/open5gs-smfd.service.in index 94322acd9..a4d5c2fc1 100644 --- a/configs/systemd/open5gs-smfd.service.in +++ b/configs/systemd/open5gs-smfd.service.in @@ -1,6 +1,6 @@ [Unit] Description=Open5GS SMF Daemon -After=networking.service +After=network-online.target Requires=systemd-networkd.service [Service] diff --git a/configs/systemd/open5gs-udmd.service.in b/configs/systemd/open5gs-udmd.service.in index ce5b87541..8a1eb73b8 100644 --- a/configs/systemd/open5gs-udmd.service.in +++ b/configs/systemd/open5gs-udmd.service.in @@ -1,6 +1,6 @@ [Unit] Description=Open5GS UDM Daemon -After=networking.service +After=network-online.target [Service] Type=simple diff --git a/configs/systemd/open5gs-upfd.service.in b/configs/systemd/open5gs-upfd.service.in index 7a9f5faba..b9bf0f1b5 100644 --- a/configs/systemd/open5gs-upfd.service.in +++ b/configs/systemd/open5gs-upfd.service.in @@ -1,6 +1,6 @@ [Unit] Description=Open5GS UPF Daemon -After=networking.service +After=network-online.target Requires=systemd-networkd.service [Service]