Hi Ian, Ian Jackson <ijack...@chiark.greenend.org.uk> writes: > Reading systemd.service(5), I'm confused about the exact syntax and > quoting for the "ExecStart=" directive. > > AFAICT from reading systemd.unit(5), the values in the unit file > general syntax are whatever comes after the =, and it is up to the > particular directive to specify the interpretation of the RHS. > > ExecStart talks about multiple commands being separated by semicolons. > It also talks about "the first argument" but it doesn't specify how > arguments are split. It tells us that shell syntax is not used. But > it provides this example: > > ExecStart=/bin/sh -c 'dmesg | tac' > > If that example is correct, something nontrivial must be going on. > I think it should be documented. To clarify: the mapping of directives to parsing function happens in http://cgit.freedesktop.org/systemd/systemd/tree/src/core/load-fragment-gperf.gperf.m4?id=9091e686f43184065381aa71929e3df36a4ea2e1#n150
The relevant parsing function is config_parse_exec(): http://cgit.freedesktop.org/systemd/systemd/tree/src/core/load-fragment.c?id=9091e686f43184065381aa71929e3df36a4ea2e1#n433 Arguments are split on WHITESPACE, which is “ \t\n\r”: http://cgit.freedesktop.org/systemd/systemd/tree/src/shared/util.h?id=9091e686f43184065381aa71929e3df36a4ea2e1#n53 I presume changing the wording of systemd.service(5) to read “Commands with their (whitespace-separated) arguments […]” would clarify. Do you agree? If so, I’ll send a patch upstream to change this. -- Best regards, Michael -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org