1

Trying to avoid possible mistakes I'd like to define and use variables to be used withing the systemd unit file itself, i.e.: not for the command executed.

For example consider this (invalid) unit:

[Unit]
CONFIG=/etc/some_dir/%i.conf
AssertPathExists=$CONFIG
#...

[Service]
EnvironmentFile=$CONFIG
# ...

So I want to define variable CONFIG and use it for several unit directives. Is that possible?

1 Answer 1

1

No, systemd units do not support this.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .