You are not logged in.

#1 2024-05-10 00:29:48

elegua
Member
Registered: 2008-03-28
Posts: 22

systemd user PATH not updating

When I add the following to ~/.config/environment.d/

90-testval.conf
TESTVAL=FOO

and `systemctl --user daemon-reload` , it shows up when I run `systemctl --user show-environment`

However, when I add

90-bin-path.conf
PATH=$HOME/bin:$PATH

the PATH does not update.

`/usr/lib/systemd/user-environment-generators/30-systemd-environment-d-generator` shows a correct PATH.

Offline

#2 2024-05-10 19:48:03

seth
Member
Registered: 2012-09-03
Posts: 57,935

Re: systemd user PATH not updating

Does not update in what context? Might it get overridden by some SHELL config that's drawn from /etc/profile.d and your shell RCs?
/etc/profile.d/path.sh

#!/bin/sh
PATH=$HOME/bin:$PATH
export PATH
chown root:root /etc/profile.d/path.sh
chmod ugo+x /etc/profile.d/path.sh

Offline

#3 2024-05-10 22:42:06

elegua
Member
Registered: 2008-03-28
Posts: 22

Re: systemd user PATH not updating

It's not updating in the context of systemd/user on a daemon-reload as evidenced by show-environment. The PATH I get is the same regardless of what I define in ~/.config/environment.d/.

Given that the generator appears to be giving me the expected PATH and other variables are being set, I figure that something is squashing my changes afterward in daemon-reload, but I'm at a loss as to how to track that down. This has worked for me in the past, but I'm setting up a new system.

Offline

#4 2024-05-11 21:48:30

seth
Member
Registered: 2012-09-03
Posts: 57,935

Re: systemd user PATH not updating

https://man.archlinux.org/man/core/syst … ce_Manager

systemd uses a fixed value of "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin" in the system manager. In case of the user manager, a different path may be configured by the distribution.

I guess that refers to DefaultEnvironment in https://man.archlinux.org/man/core/syst … .conf.5.en (only)…

Offline

#5 2024-05-14 15:37:26

elegua
Member
Registered: 2008-03-28
Posts: 22

Re: systemd user PATH not updating

Ran a system update and things are suddenly working. Guess it was a bug, still not sure with what, though.

Offline

Board footer

Powered by FluxBB