So, in systemd we have a mechanism to pass environment variables to the process using PassEnvironment [https://www.freedesktop.org/software/systemd/man/systemd.exec.html]

Is it possible to specify default values for these variables in systemd service file itself ?

Could you provide an example ?

PS: I have tried out PassEnvironment='POLL_INTERVAL=10' but it is not working.


Use the Environment= parameter instead. PassEnvironment= is used to pass variables whose values are defined within the systemd process itself (PID 1).



Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.