Bug#1018872: systemd.service COMMAND LINE misses command search, if starting with "+".

Michael Biebl biebl at debian.org
Thu Sep 1 11:01:32 BST 2022


Am 01.09.22 um 11:04 schrieb Harald Bergmann:
> Hello Michael,
> 
> many thanks for your quick test!
> Please try to combine the two ExecStartPre to a single one by ;.
> Your way of multiple command lines is likely another way of workaround.

It's not a workaround, it's the only valid syntax.
As mentioned in the other reply, there can only be a single command per 
Exec* line.
You can have multiple ExecStartPre lines or a single ExecStartPre line 
using sh -c " ". Within that shell you can run multiple commands as you 
wish, basically do anything.

I personally prefer the multiple ExecStartPre lines though, as it makes 
it easier to debug on failures. You'll see exactly which line failed 
(and its error code)

And if you have a ExecStart=sh -c " " command which is complex and spans 
multiple lines, my recommendation is to move that into a separate, 
external shell script that can be called directly fro ExecStart=

Michael




-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20220901/007237de/attachment.sig>


More information about the Pkg-systemd-maintainers mailing list