You are not logged in.

#1 2017-12-11 17:09:05

ninian
Member
From: United Kingdom
Registered: 2008-02-24
Posts: 726
Website

Upgrade of 'filesystem' 2017.10-2 /etc/profile causes $PATH problem

Previous version of /etc/profile explicitly set:

PATH="/usr/local/sbin:/usr/local/bin:/usr/bin"

New version uses a function to append paths:

appendpath () {
    case ":$PATH:" in
        *:"$1":*)
            ;;
        *)
            PATH="$PATH:$1"
    esac
}
appendpath '/usr/local/sbin'
appendpath '/usr/local/bin'
appendpath '/usr/bin'

However, since PATH=/usr/bin apparently on entry to profile, the final PATH value now ends up as:

/usr/bin:/usr/local/sbin:/usr/local/bin

which is different and illogical.
Any wrapper scripts placed in /usr/local/bin will not be found before the original binary in /usr/bin.
This looks like a bug; please confirm if you have also experienced this problem.

Offline

#2 2017-12-11 18:16:38

loqs
Member
Registered: 2014-03-06
Posts: 19,091

Re: Upgrade of 'filesystem' 2017.10-2 /etc/profile causes $PATH problem

As I have nothing installed to /usr/local/bin I am not affected but I suggest you report it as a bug to clarify if the change was intentional.
Edit:
https://bugs.archlinux.org/task/56683

Last edited by loqs (2017-12-11 18:19:59)

Offline

#3 2017-12-11 18:29:43

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: Upgrade of 'filesystem' 2017.10-2 /etc/profile causes $PATH problem

I'm not experiencing the same problem but looking at the path ordering on my system that just means my PATH is either set to "/usr/local/bin" or "/usr/local/bin:/usr/local/sbin:/usr/bin" beforehand.
If it were empty, the order of those 3 paths would have been "/usr/local/sbin:/usr/local/bin:/usr/bin". Not sure what has set it before /etc/profile and /etc/profile.d/*.sh though.

$ printenv PATH
/usr/local/bin:/usr/local/sbin:/usr/bin:/opt/cuda/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

Offline

#4 2017-12-11 19:03:38

loqs
Member
Registered: 2014-03-06
Posts: 19,091

Re: Upgrade of 'filesystem' 2017.10-2 /etc/profile causes $PATH problem

Omar007 wrote:

Not sure what has set it before /etc/profile and /etc/profile.d/*.sh though.

The shell zsh

% echo $PATH
/usr/bin

bash

$ echo $PATH
/usr/local/bin:/usr/bin:/bin

Offline

#5 2017-12-11 19:13:52

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: Upgrade of 'filesystem' 2017.10-2 /etc/profile causes $PATH problem

The shell is what I thought first as well but neither of those values would result in the PATH on my system.. I'll probably look into this later, now I'm curious tongue

Offline

#6 2017-12-11 19:18:26

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,525
Website

Re: Upgrade of 'filesystem' 2017.10-2 /etc/profile causes $PATH problem

Omar007 wrote:

The shell is what I thought first as well but neither of those values would result in the PATH on my system.. I'll probably look into this later, now I'm curious tongue

Yes it would.  You said in the shells thread that you use zsh.  So zsh starts it with /usr/bin.  Then /usr/local/sbin is prepended followed by /usr/local/bin (also prepended) but /usr/bin is skipped as it was already there.  This if followed by everything in /etc/profile.d/ which append to the PATH, which would result in precisely the PATH value you shared in your previous post.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#7 2017-12-11 20:17:23

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: Upgrade of 'filesystem' 2017.10-2 /etc/profile causes $PATH problem

Trilby wrote:

So zsh starts it with /usr/bin.

I've had a quick look around my filesystem and as far as I can tell, /usr/bin comes from login.defs. I can't find anything in the zsh configs setting a PATH value.
Is it hard-coded?

Trilby wrote:

Then /usr/local/sbin is prepended followed by /usr/local/bin (also prepended) but /usr/bin is skipped as it was already there.

Where would these be prepended? /etc/profile is appendpathing these to PATH, not prepending them.

Hence me thinking there must still be something else in-between, otherwise I'd end up with the same path as the OP, with /usr/bin first.

Last edited by Omar007 (2017-12-11 20:20:03)

Offline

#8 2017-12-11 20:43:53

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,525
Website

Re: Upgrade of 'filesystem' 2017.10-2 /etc/profile causes $PATH problem

Oops, you're right, I misread the /etc/profile.  I thought (despite the function name) that it was prepending in the function.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB