So, in systemd we have a mechanism to pass environment variables to the process using PassEnvironment.

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

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

Could you provide an example?

1 Answer 1


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


  • what if the variable is an environmental variable? Dec 10, 2022 at 11:37

You must log in to answer this question.

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