From c824c3bcc1c8da2ee9daa38bd2c6f222b0fee2c9 Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Fri, 14 May 2021 13:51:15 -0700 Subject: [PATCH] Add support for multiple env files for systemd unit Signed-off-by: Brad Davidson --- install.sh | 4 +++- k3s.service | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 3c79e952de..91f4cbdb19 100755 --- a/install.sh +++ b/install.sh @@ -728,7 +728,9 @@ WantedBy=multi-user.target [Service] Type=${SYSTEMD_TYPE} -EnvironmentFile=${FILE_K3S_ENV} +EnvironmentFile=-/etc/default/%N +EnvironmentFile=-/etc/sysconfig/%N +EnvironmentFile=-${FILE_K3S_ENV} KillMode=process Delegate=yes # Having non-zero Limit*s causes performance problems due to accounting overhead diff --git a/k3s.service b/k3s.service index fba6c19046..6ea1f8a4a5 100644 --- a/k3s.service +++ b/k3s.service @@ -6,6 +6,8 @@ Wants=network-online.target [Service] Type=notify +EnvironmentFile=-/etc/default/%N +EnvironmentFile=-/etc/sysconfig/%N EnvironmentFile=-/etc/systemd/system/k3s.service.env ExecStart=/usr/local/bin/k3s server KillMode=process