From 864ed2a4f191cc5f1abd2b91f94a3e65f9b41f6a Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Wed, 12 Feb 2025 22:38:47 +0000 Subject: [PATCH] Set User in k3s systemd unit This ensures that the $HOME and $USER env vars get set. We have worked around this on the RKE2 side by setting it manually in the default .env file: https://github.com/rancher/rke2/blob/master/bundle/lib/systemd/system/rke2-server.env This is required for loading credentials from shared credentials files (`/root/.aws/credentials`) Signed-off-by: Brad Davidson --- install.sh | 1 + install.sh.sha256sum | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 6c337e23567..1ba926f5815 100755 --- a/install.sh +++ b/install.sh @@ -993,6 +993,7 @@ EnvironmentFile=-/etc/sysconfig/%N EnvironmentFile=-${FILE_K3S_ENV} KillMode=process Delegate=yes +User=root # Having non-zero Limit*s causes performance problems due to accounting overhead # in the kernel. We recommend using cgroups to do container-local accounting. LimitNOFILE=1048576 diff --git a/install.sh.sha256sum b/install.sh.sha256sum index 6ee6bdbb8bc..12650287bae 100644 --- a/install.sh.sha256sum +++ b/install.sh.sha256sum @@ -1 +1 @@ -527dc64257a261b83042eb550f24648d2664656e8aef3d4633ac2a746848c6ae install.sh +9d5fc42bf825d3e8dcc8682c8bac071b1de18019af81f85519ccbe5c919e0896 install.sh