Bug#869144: systemd: Setting PATH with environment.d does not work
Stefan Tatschner
stefan.tatschner at gmail.com
Thu Jul 20 22:24:01 BST 2017
Subject: systemd: Setting PATH with environment.d does not work
Package: systemd
Version: 234-1
Severity: normal
Dear Maintainer,
Setting the $PATH variable with systemd's environment.d feature does not work
as expected. I have this content in my
`~/.config/environment.d/99-defaults.conf`:
```
GOPATH=$HOME/Go
PATH1=$GOPATH/bin:$HOME/.cargo/bin:$HOME/.local/bin:$PATH
PATH=$GOPATH/bin:$HOME/.cargo/bin:$HOME/.local/bin:$PATH
```
After a login in gnome3 I expect to see `$PATH` and `$PATH1` to be equal; with
expanded `$GOPATH` prepended.
On a shell I get this instead:
```
$ printenv PATH PATH1 GOPATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
/home/stefan/Go/bin:/home/stefan/.cargo/bin:/home/stefan/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
/home/stefan/Go
```
```
$ systemctl --user show-environment
...
GOPATH=/home/stefan/Go
PATH1=/home/stefan/Go/bin:/home/stefan/.cargo/bin:/home/stefan/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/u
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
...
```
`$PATH` seems to be hardcoded somewhere which overwrites my setting; important
fact: I use gnome on **wayland**. So I have no shellscripts that are being
exectued during login.
-- Package-specific info:
-- System Information:
Debian Release: buster/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 4.11.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8),
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages systemd depends on:
ii adduser 3.115
ii libacl1 2.2.52-3+b1
ii libapparmor1 2.11.0-6
ii libaudit1 1:2.7.7-1+b1
ii libblkid1 2.29.2-2
ii libc6 2.24-12
ii libcap2 1:2.25-1
ii libcryptsetup4 2:1.7.3-4
ii libgcrypt20 1.7.8-2
ii libgpg-error0 1.27-3
ii libidn11 1.33-1
ii libip4tc0 1.6.1-2
ii libkmod2 24-1
ii liblz4-1 0.0~r131-2+b1
ii liblzma5 5.2.2-1.3
ii libmount1 2.29.2-2
ii libpam0g 1.1.8-3.6
ii libseccomp2 2.3.1-2.1
ii libselinux1 2.6-3+b2
ii libsystemd0 234-1
ii mount 2.29.2-2
ii procps 2:3.3.12-3
ii util-linux 2.29.2-2
Versions of packages systemd recommends:
ii dbus 1.10.20-1
ii libpam-systemd 234-1
Versions of packages systemd suggests:
ii policykit-1 0.105-18
pn systemd-container <none>
Versions of packages systemd is related to:
pn dracut <none>
ii initramfs-tools 0.130
ii udev 234-1
-- Configuration Files:
/etc/systemd/resolved.conf changed [not included]
-- no debconf information
More information about the Pkg-systemd-maintainers
mailing list