Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get.sh script exists with non-zero exit code on CentOS #683

Closed
1 of 2 tasks
welteki opened this issue May 4, 2022 · 4 comments · Fixed by #685
Closed
1 of 2 tasks

get.sh script exists with non-zero exit code on CentOS #683

welteki opened this issue May 4, 2022 · 4 comments · Fixed by #685

Comments

@welteki
Copy link
Contributor

welteki commented May 4, 2022

When running curl -sLS https://get.arkade.dev | sudo sh on CentOS the script exits with a non-zero exit code. Despite this arkade is installed.

Expected Behaviour

curl -sLS https://get.arkade.dev | sudo sh should exit successfully

Current Behaviour

curl -sLS https://get.arkade.dev | sudo sh exits with non-zero exit code.

Are you a GitHub Sponsor yet (Yes/No?)

  • Yes
  • No

Possible Solution

Steps to Reproduce (for bugs)

Run curl -sLS https://get.arkade.dev | sudo sh

Output:
Screenshot 2022-05-04 at 17 21 40

Context

Discovered this issue while testing openfaas/faasd#261 on CentOS

If requesting a CLI for "arkade get"

How many downloads does this tool have? Check at:

https://somsubhra.github.io/github-release-stats/

Your Environment

  • What Kubernetes distribution are you using?
kubectl version
  • Operating System and version (e.g. Linux, Windows, MacOS):
uname -a

cat /etc/os-release

Screenshot 2022-05-04 at 17 25 49

  • What arkade version is this?
arkade version
@rgee0
Copy link
Contributor

rgee0 commented May 4, 2022

Replicated:

[root@centos-s-2vcpu-2gb-intel-lon1-01 ~]# curl -sLS https://get.arkade.dev | sudo sh
x86_64
Downloading package https://github.com/alexellis/arkade/releases/download/0.8.23/arkade as /tmp/arkade
Download complete.

Running with sufficient permissions to attempt to move arkade to /usr/local/bin
New version of arkade installed to /usr/local/bin
which: no ark in (/sbin:/bin:/usr/sbin:/usr/bin)
Creating alias 'ark' for 'arkade'.
main: line 187: arkade: command not found

Looks like its something to do with sudo:

# arkade
            _             _      
  __ _ _ __| | ____ _  __| | ___ 
 / _` | '__| |/ / _` |/ _` |/ _ \
| (_| | |  |   < (_| | (_| |  __/
 \__,_|_|  |_|\_\__,_|\__,_|\___|

Open Source Marketplace For Developer Tools

Usage:
  arkade [flags]
  arkade [command]

Available Commands:
  completion  Output shell completion for the given shell (bash or zsh)
  get         The get command downloads a tool
  help        Help about any command
  info        Find info about a Kubernetes app
  install     Install Kubernetes apps from helm charts or YAML files
  kasten      Sponsored Apps for kasten
  system      System apps
  uninstall   Uninstall apps installed with arkade
  update      Print update instructions
  venafi      Sponsored Apps for Venafi
  version     Print the version

Flags:
  -h, --help   help for arkade

Use "arkade [command] --help" for more information about a command.

When run with sudo

[root@centos-s-2vcpu-2gb-intel-lon1-01 ~]# sudo arkade
sudo: arkade: command not found

@Shikachuu
Copy link
Contributor

@welteki or @rgee0 can you provide bash --version?

If the problem only occures when using the get.sh, which seems like the case here since, I think its good to know the bash version!

Thanks! 😄

@rgee0
Copy link
Contributor

rgee0 commented May 4, 2022

This is mine:

# bash --version
GNU bash, version 5.1.8(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

@rgee0
Copy link
Contributor

rgee0 commented May 4, 2022

Seems to be $PATH related.

/etc/sudoers on CentOS 9 seems to set this for the path when sudo is used:

Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin

Which means that running sudo arkade sees:

# ls -la $(which arkade)
-rwxr-xr-x. 1 root root 7716864 May  4 11:45 /usr/local/bin/arkade

# sudo arkade
sudo: arkade: command not found

Mutating /etc/sudoers to use:

Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin/

Sees:

# sudo arkade
            _             _      
  __ _ _ __| | ____ _  __| | ___ 
 / _` | '__| |/ / _` |/ _` |/ _ \
| (_| | |  |   < (_| | (_| |  __/
 \__,_|_|  |_|\_\__,_|\__,_|\___|

Open Source Marketplace For Developer Tools

Usage:
  arkade [flags]
  arkade [command]

Available Commands:
  completion  Output shell completion for the given shell (bash or zsh)
  get         The get command downloads a tool
  help        Help about any command
  info        Find info about a Kubernetes app
  install     Install Kubernetes apps from helm charts or YAML files
  kasten      Sponsored Apps for kasten
  system      System apps
  uninstall   Uninstall apps installed with arkade
  update      Print update instructions
  venafi      Sponsored Apps for Venafi
  version     Print the version

Flags:
  -h, --help   help for arkade

Use "arkade [command] --help" for more information about a command.

I'm not suggesting hacking about with /etc/sudoers is the solution, more just understanding the behaviour/cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants