Bug#869144: systemd: Setting PATH with environment.d does not work

Michael Biebl biebl at debian.org
Thu Jul 20 23:49:35 BST 2017


Am 20.07.2017 um 23:24 schrieb Stefan Tatschner:
> 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.
> 

The PATH you have above is not hard-coded in systemd afaics.
To me this looks like PATH is set somewhere outside of systemd and then
pushed into the systemctl --user environment.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20170721/e4cfad2c/attachment-0002.sig>


More information about the Pkg-systemd-maintainers mailing list