From 08c89eb1d54066c5f4a645235829cff89b826b56 Mon Sep 17 00:00:00 2001 From: TJ Hoplock Date: Thu, 27 Jun 2024 00:46:27 -0400 Subject: [PATCH] fix(build): fix env var usage in packaged systemd unit file 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. --- packaging/systemd/mango.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/systemd/mango.service b/packaging/systemd/mango.service index 13f2894..56e3f5d 100644 --- a/packaging/systemd/mango.service +++ b/packaging/systemd/mango.service @@ -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