Skip to content

Commit

Permalink
fix(build): fix env var usage in packaged systemd unit file
Browse files Browse the repository at this point in the history
From docs
(https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#Command%20lines):

> Basic environment variable substitution is supported. Use "${FOO}" as
part of a word, or as a word of its own, on the command line, in which
case it will be erased and replaced by the exact value of the
environment variable (if any) including all whitespace it contains,
always resulting in exactly a single argument. Use "$FOO" as a separate
word on the command line, in which case it will be replaced by the value
of the environment variable split at whitespace, resulting in zero or
more arguments. For this type of expansion, quotes are respected when
splitting into words, and afterwards removed.

Using curly brackets was causing this to be interpeted by mango as a
single massive command line arg. We want splitting here.
  • Loading branch information
tjhop committed Jun 27, 2024
1 parent b9df464 commit 08c89eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packaging/systemd/mango.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ After=network.target

[Service]
Environment="ARGS=--inventory.path /opt/mango/inventory --inventory.reload-interval '5m'"
ExecStart=/usr/bin/mango ${ARGS}
ExecStart=/usr/bin/mango $ARGS
ExecReload=/bin/kill -SIGHUP $MAINPID
Restart=on-failure
KillSignal=SIGINT
Expand Down

0 comments on commit 08c89eb

Please sign in to comment.