fn icon indicating copy to clipboard operation
fn copied to clipboard

Install path of fn executable is not valid on CentOS

Open blues-man opened this issue 5 years ago • 2 comments

Current script assumes that /usr/local/bin is in PATH then the installation fails on CentOS 7 because it is not in the default PATH.

This was discussed also in #973 and can be fixed adding it to the PATH if not present yet.

blues-man avatar Feb 06 '19 10:02 blues-man

thanks for catching this. I'm uncertain about proceeding, for a couple of reasons:

  1. this doesn't fix #973 - installing to $HOME may fix that (though certainly some things don't allow writing to $HOME either, maybe we can't win here 100% but we might get better coverage than /usr/local/bin)
  2. running the docker image of centos7 (which is maybe not the perfect representation of a centos installation, nonetheless...) shows that /usr/local/bin exists in the default path, and am a little uneasy about https://github.com/fnproject/cli/pull/531 to modify user paths. see:
 ✗: docker run centos:7 sh -c 'echo $PATH'
Unable to find image 'centos:7' locally          
7: Pulling from library/centos                    
Digest: sha256:184e5f35598e333bfa7de10d8fb1cebb5ee4df5bc0f970bf2b1e7c7345136426
Status: Downloaded newer image for centos:7   
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

i'm inclined to install to home as a fix for this, as it'll pick up some of the issues from #973 as well. any thoughts?

rdallman avatar Feb 11 '19 19:02 rdallman

Hello, I was trying out it on latest CentOS 7 Cloud image available from: https://docs.cloud.oracle.com/iaas/images/image/25384cd8-6314-4acf-abc0-1fcebb875a9a/

and from root user, /usr/local/bin was not in the PATH, that's why I put that check. On a general distribution CentOS 7 ISO, I found it in root $PATH, so it may depend on the image version.

I agree btw that it should use /usr/local/bin for privileged installation of non-packaged software and $HOME for all other ones, maybe a check if id -u for the former, else $HOME

blues-man avatar Feb 14 '19 18:02 blues-man