[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 <adam@farden.cz>
This commit is contained in:
Adam Farden 2020-09-26 10:44:06 +02:00 committed by GitHub
parent fc55904d82
commit 86d2e2a5f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 0 deletions

View File

@ -643,6 +643,7 @@ create_systemd_service_file() {
[Unit] [Unit]
Description=Lightweight Kubernetes Description=Lightweight Kubernetes
Documentation=https://k3s.io Documentation=https://k3s.io
After=network-online.target
Wants=network-online.target Wants=network-online.target
After=network-online.target After=network-online.target

View File

@ -2,6 +2,7 @@
Description=Lightweight Kubernetes Description=Lightweight Kubernetes
Documentation=https://k3s.io Documentation=https://k3s.io
After=network-online.target After=network-online.target
Wants=network-online.target
[Service] [Service]
Type=notify Type=notify

View File

@ -648,6 +648,7 @@ create_systemd_service_file() {
[Unit] [Unit]
Description=Lightweight Kubernetes Description=Lightweight Kubernetes
Documentation=https://k3s.io Documentation=https://k3s.io
After=network-online.target
Wants=network-online.target Wants=network-online.target
After=network-online.target After=network-online.target
Conflicts=${conflicts} Conflicts=${conflicts}