I have a set of environment variables that I need to be globally set for all users and all systemd services. I don't want to have to specify them it two different locations.

I tried setting them /etc/environment and /etc/profile.d. These both worked, but only for logged in users, not systemd services.

I tried setting them /etc/default/init and that didn't work for any process.

How can I set environment variables globally for all users and all services without having to specify them redundantly in multiple locations?

Distribution: Raspbian

  • Systemd intentionally runs services in a clean environment. – jordanm Mar 20 '17 at 1:28

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.