Web lists-archives.com

Re: Setting default $PATH for all users




On 2/10/19, Richard Owlett <rowlett@xxxxxxxxxxx> wrote:
> On 02/10/2019 05:00 PM, Lee wrote:
>> On 2/10/19, Andy Smith <andy@xxxxxxxxxxxxxx> wrote:
>>> Hello,
>>>
>>> On Sun, Feb 10, 2019 at 02:57:22PM -0600, Richard Owlett wrote:
>>>> I used "grep -r /usr/local/games /etc" which yielded "/etc/login.defs"
>>>> and
>>>> "/etc/profile". Editing those two files had no effect.
>>>
>>> How are you determining that changes to /etc/profile had no effect?
>>> Because changes there (or in files in /etc/profile.d/) should affect all
>>> new shels that you launch. Example:
>>>
>>> $ cat /etc/profile.d/extrapath.sh
>>> export PATH=$PATH:/foo
>>>
>>> Then I open a new shell and echo $PATH, /foo is in there.
>>>
>>> If that is not your experience, you are doing something wrong, or your
>>> system is very broken.
>>
>> Or you're using xfce which seems to ignore .profile & .bash_profile
>> Creating an /etc/profile.d/extrapath.sh from your example didn't do
>> anything for me.
>>
>> adding the line
>> export PATH=$PATH:/foo
>> to /etc/bash.bashrc however...
>>
>> followup question - why are the bash "login" dot files ignored if
>> you're using xfce?
>
> Perhaps 'cause I've never used xfce?
> For the record I'm using MATE as DE and lightdm as DM.

Which is semi-interesting I guess, but you're the one that wanted a
single location to add $PATH elements for all current & future users -
yes?  The interesting answer would be if adding
export PATH=$PATH:/foo
to /etc/bash.bashrc is what you're looking for.

Regards,
Lee