Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

systemd unit: make EnvironmentFile optional #2886

Merged
merged 1 commit into from
Feb 3, 2021

Conversation

AkihiroSuda
Copy link
Contributor

@AkihiroSuda AkihiroSuda commented Feb 2, 2021

Proposed Changes

Make EnvironmentFile optional.

Previously, k3s.service was failing when the EnvironmentFile does not exist:

Feb 02 17:17:30 suda-ws01 systemd[1]: k3s.service: Failed to load environment files: No such file or directory
Feb 02 17:17:30 suda-ws01 systemd[1]: k3s.service: Failed to run 'start' task: No such file or directory
Feb 02 17:17:30 suda-ws01 systemd[1]: k3s.service: Failed with result 'resources'.
Feb 02 17:17:30 suda-ws01 systemd[1]: Failed to start Lightweight Kubernetes.

ref: https://unix.stackexchange.com/questions/404199/documentation-of-equals-minus-in-systemd-unit-files

Types of Changes

BugFix

Linked Issues

For #2923

Verification

systemctl status k3s.service without /etc/systemd/system/k3s.service.env.

Previously, k3s.service was failing when the EnvironmentFile does not exist:
```
Feb 02 17:17:30 suda-ws01 systemd[1]: k3s.service: Failed to load environment files: No such file or directory
Feb 02 17:17:30 suda-ws01 systemd[1]: k3s.service: Failed to run 'start' task: No such file or directory
Feb 02 17:17:30 suda-ws01 systemd[1]: k3s.service: Failed with result 'resources'.
Feb 02 17:17:30 suda-ws01 systemd[1]: Failed to start Lightweight Kubernetes.
```

ref: https://unix.stackexchange.com/questions/404199/documentation-of-equals-minus-in-systemd-unit-files

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
@AkihiroSuda AkihiroSuda requested a review from a team as a code owner February 2, 2021 08:26
@brandond brandond self-assigned this Feb 2, 2021
@brandond brandond merged commit 732228f into k3s-io:master Feb 3, 2021
@brandond
Copy link
Member

brandond commented Feb 16, 2021

@AkihiroSuda do you think we should also fix this in the install script? Not sure what your use case is; it probably matters less with the install script because it also creates the required .env file.

cc @ShylajaDevadiga

@AkihiroSuda
Copy link
Contributor Author

it probably matters less with the install script because it also creates the required .env file.

I agree. Not necessary for the scripted installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants