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

fix parsing of backslash at end of line #184

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MasonM
Copy link

@MasonM MasonM commented Dec 8, 2024

If you have an option with a line ending with a backslash that's on the last line of the file, then the option isn't added to the corresponding section. I discovered this because the k3s installer generates a unit file that looks like this:

[Service]
Type=notify
ExecStart=/usr/local/bin/k3s \
        server \

but attempting to start it generates the error ERROR:systemctl: k3s.service: Service lacks both ExecStart and ExecStop= setting. Refusing. because ExecStart wasn't being added to the Service section

If you have an option with a line ending with a backslash that's on the
last line of the file (or preceeding the last line when it's a comment
or empty space), then the option isn't added to the corresponding
section. I discovered this because the [k3s installer](https://get.k3s.io/)
generates a unit file that looks like this:
```
[Service]
Type=notify
ExecStart=/usr/local/bin/k3s \
        server \
```

but attempting to start it generates the error `ERROR:systemctl: k3s.service: Service lacks both ExecStart and ExecStop= setting. Refusing.`

Signed-off-by: Mason Malone <[email protected]>
Signed-off-by: Mason Malone <[email protected]>
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.

1 participant