On 11/23/23 05:06, Bernhard Walle wrote:
Hello,

I want to add some directory to $PATH for each user. In the past, I added a file /etc/profile.d/path.sh, but that doesn't work any more, only when I manually start bash as login shell (or modify the setting of gnome-terminal).

My next attempt was to use systemd's /etc/environment.d/path.conf

     PATH=${PATH}:/opt/vendor/product/bin
     XPATH=${PATH}:/opt/vendor/product/bin

but that doesn't work either. While XPATH appears, PATH is still the default.

     systemctl show-environment --user

     PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
NCP_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/ncp/clnt/bin:/opt/ncp/clnt/bin

To be honest, I'm quite confused where that default path is defined. Even when I modify /etc/login.defs (ENV_PATH) or /etc/profile, I still get the default value.

Of course I can edit my own ~/.bashrc or /etc/bashrc, but that's not what I want since then only bash gets the PATH environment, not other shells or other programs.

Can somebody help me, please? Thanks a lot.


Kind regards,
Bernhard

I'm user 1000 and have had the expected results by putting a modified path in my .profile but it is not automatic, I have to . .profile for every terminal I start. I have 2 non-stock dirs in my /home/me path, bin and AppImages, and I put them ahead of the rest of the default path. Now if someone would tell me how to make that automatic I'd be delighted.



.

Cheers, Gene Heskett.
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis

Reply via email to