The systemd unit for k3s should differ between agents and servers #85813
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation for this change
The agent part of k3s doesn't notify systemd of startup and should therefore be of type "exec" rather than "notify". As far as I can tell the ansible template is wrong. When actually fetching the installation script via https://get.k3s.io you see that they use different systemd types for agents and servers.
Since I've had my own k3s module for a while I happen to know that this is indeed the case since agents won't start properly without this (but you won't notice in single node "clusters" ofc).
Further verification that this is the case here:
https://github.com/rancher/k3s/blob/553517e19433c6b3e58fd25e7ac83ed9b6d5fe1e/pkg/cli/server/server.go#L183 - server does notify systemd
The agent lacks this notification:
https://github.com/rancher/k3s/blob/master/pkg/cli/agent/agent.go
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)