From 86d2e2a5f88b72f1834e219463577604efd1771c Mon Sep 17 00:00:00 2001 From: Adam Farden Date: Sat, 26 Sep 2020 10:44:06 +0200 Subject: [PATCH] [systemd] really wait for network to come online (#1665) Wants= is required to actually set the dependency on network-online.service After= is required or k3s.service will be started at the same time as network-online.service In network environments with slow DHCP, both are required to ensure valid network configuration for k3s Signed-off-by: Adam Farden --- install.sh | 1 + k3s.service | 1 + package/rpm/install.sh | 1 + 3 files changed, 3 insertions(+) diff --git a/install.sh b/install.sh index 00035ece12..be08bbcbf8 100755 --- a/install.sh +++ b/install.sh @@ -643,6 +643,7 @@ create_systemd_service_file() { [Unit] Description=Lightweight Kubernetes Documentation=https://k3s.io +After=network-online.target Wants=network-online.target After=network-online.target diff --git a/k3s.service b/k3s.service index 8da71c7d9c..377e40560c 100644 --- a/k3s.service +++ b/k3s.service @@ -2,6 +2,7 @@ Description=Lightweight Kubernetes Documentation=https://k3s.io After=network-online.target +Wants=network-online.target [Service] Type=notify diff --git a/package/rpm/install.sh b/package/rpm/install.sh index 7e976a6a45..3e2ac5411a 100755 --- a/package/rpm/install.sh +++ b/package/rpm/install.sh @@ -648,6 +648,7 @@ create_systemd_service_file() { [Unit] Description=Lightweight Kubernetes Documentation=https://k3s.io +After=network-online.target Wants=network-online.target After=network-online.target Conflicts=${conflicts}