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
Use EnvironmentFile instead of Environment in systemd units. Closes #… #23337
Conversation
@teh, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edolstra, @bluescreen303 and @abbradar to be potential reviewers. |
Maybe this can be made conditional on the length of the string? Otherwise it's going to add a huge number of files to the system closure. |
@edolstra - yea see my comment on merge. My main worry was having a less-tested path around. Looking at my servers this will add ~200 files + symlinks. If you still prefer the conditional I'll add that. |
Yeah, I'd prefer to avoid the overhead for the common case. |
@edolstra - Please have a look. I think we also had a bug in that the entire line musn't be longer than 2048, and AFAICT we only checked the right hand side of Now that I think about it I'm not even sure the assumption holds that |
https://github.com/systemd/systemd/blob/b965427b59a6912a46e1cdb26b732d3ea396b332/src/basic/fileio.c#L302 - doesn't look like there's a limit so the spillover solution should work. Off-topic: The systemd parsing code looks quite scary, I really wish it wasn't c ... |
8148bd5
to
c94cb9f
Compare
Making rounds in the older PRs, this seems a worthwhile addition, what's left to do, if anything, before reviewing and then merging? I ran the added test:
And everything ran fine, while running the same test on
|
@teh this is super useful... are you happy with this being merged as is? I don't notice any obvious problems so after a rebase and whatnot LGTM 👍 |
@aanderse it seem the max line length is now ~1MiB but when I tried it failed so I did a rebase with 2048. |
If the max length has been increased and it doesn't seem to be working we should probably investigate that. I would say this PR is no longer required but instead an investigation into why you are having issues and see if we can reproduce? What is your test case? |
I replaced the spillover check with I agree that with 1MB line length this is much less acute. My |
Thanks @teh! |
…22829.
This is the simplest solution I could come up with.
We could also add an if-statement and only write environment files if the line would be longer than 2048, but then we'd introduce a potentially untested branch.