Skip to content

Commit

Permalink
Set User in k3s systemd unit
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
brandond committed Mar 3, 2025
1 parent 8aa543e commit 864ed2a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion install.sh.sha256sum
Original file line number Diff line number Diff line change
@@ -1 +1 @@
527dc64257a261b83042eb550f24648d2664656e8aef3d4633ac2a746848c6ae install.sh
9d5fc42bf825d3e8dcc8682c8bac071b1de18019af81f85519ccbe5c919e0896 install.sh

0 comments on commit 864ed2a

Please sign in to comment.