2

I believe systemd-environment-d-generator parses conf files under /etc/environment.d/.

cat /etc/environment.d/60-foo.conf FOO=xxx 

But even after reboot, the environment variable 'FOO' does not appear in user processes.

How to let my systemd take cake of /etc/environment.d/* files?

  • Distribution

    Archlinux x86_64

  • systemd version

    systemd 251 (251.4-1-arch)

1 Answer 1

2

From my understanding of this: https://github.com/systemd/systemd/issues/12938

/etc/environment.d/ only affects services, not user sessions.

For my purposes (adding a directory to $XDG_DATA_DIRS), adding the following to /etc/profile.d/something.sh works fine:

[testuser@fedora ~]$ cat /etc/profile.d/portmaster.sh XDG_DATA_DIRS="/var/lib/portmaster/exports/share:${XDG_DATA_DIRS}" 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.