Create a unit with an option longer than 2048 characters and attempt to start it. Check `systemctl status` and you are likely to see an error. The unit I used is a single ExecStart statement trying to echo 2018 periods: [Service] ExecStart=/bin/bash -c "echo ................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................." And here are the logs: Oct 21 23:54:53 core-01 systemd[1]: [/run/systemd/system/foo.service:3] Missing '='. Oct 21 23:54:58 core-01 systemd[1]: [/run/systemd/system/foo.service:2] String is not UTF-8 clean, ignoring assignment: /bin/bash -c "echo .................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................. Note that the error seems to be telling me I have a malformed option line, but it clearly chopped off the trailing double quote that would make it valid. I dug into this a bit, and it looks like shared/config-parser.c's config_parse uses LINE_MAX, which is defined as 2048 on my system. I tried googling around for any documentation of what the actual line limit is, and came up empty handed. The ideal path forward here is to remove the line length limit. If that is unreasonable, this limit should at least be documented somewhere obvious. Additionally, the line length should be checked and logged, as the unrelated error I ran into ("String is not UTF-8 clean") is a red herring.
Is there any available workaround for this issue? I know with ExecStart, you can use a backslash to suppress the newline character, but this appears specific to ExecStart, and it does not work with other parameters such as Environment.
We have to enforce a line limit here, we cannot accept unbounded lines. Currently we use glibc's LINE_MAX limit for enforcement. We could of course bump the limit, but that's really just an arms race. We should probably consider overly long lines parse failures. THe current bheaviour of just blindly pretend there was a line break after 2k chars is certaionly not good.
This is also tracked at: https://github.com/systemd/systemd/issues/3302 Closing this here.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.