Longest ExecStart command line

I have been reviewing a lot of systemd job files, and found a systemd unit file on Ubuntu 20.04.2 with a ExecStart command that is 4284 characters long, it occurred to me to ask – what is the maximum length permitted?

Asked By: XXX

||

According to man systemd.syntax:

The limit on line length is very large (currently 1 MB), but it is
recommended to avoid such long lines and use multiple directives,
variable substitution, or other mechanism as appropriate for the given
file type.

I’d expect a long command line to run into problems with ARG_MAX first given the very permissible line length size.

Answered By: muru
Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.