I want to use a variable in a unit file. Note, I do not want an environment variable, as I do not want the variable to be visible in the service. I just want to minimize redundancy in the unit file. eg, I'd like to do something like:

ExecStart=${path}/bin/executable -c ${path}/etc/blah.cfg

Can this be done without resorting to sh -c "path= $path/bin/executable ...." with an Environment directive?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.