[systemd-devel] Formatting Execstart= for readability
Reindl Harald
h.reindl at thelounge.net
Wed Aug 16 10:09:01 UTC 2017
Am 16.08.2017 um 12:04 schrieb Mantas Mikulėnas:
> On Wed, Aug 16, 2017 at 12:09 PM, Reindl Harald <h.reindl at thelounge.net
> <mailto:h.reindl at thelounge.net>> wrote:
>
>
> Am 16.08.2017 um 10:31 schrieb Mantas Mikulėnas:
>
> Just put everything in a shell script. (That way you can test it
> directly without systemd, too.)
>
> With bash, you can use inline comments in arrays:
>
> #!/usr/bin/env bash
> args=(
> -X POST # foo
> -d "fizz=systemd" # some docs
> -d "some=else" # more docs
> https://requestb.in/foo
> )
>
> exec curl "${args[@]}"
>
>
> this is the worst recommendation one can give - really - that way
> you easily lose all the advantages of systemd in case of error handling
>
>
> For example?
what is the MAINPID - bash or curl - in that case?
why inthe world should someone sacrifice the advantage of having the
executebale directly started because of inline comments where a smart
comments-block does the same
[Service]
ExecStart=/usr/bin/curl -X POST
-d "fizz=systemd" # some docs
-d "some=else" # more docs
versus
[Service]
# fizz: somedocs
# some: moredocs
ExecStart=/usr/bin/curl -X POST -d "fizz=systemd" -d "some=else"
More information about the systemd-devel
mailing list