-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
sudo crictl: not found if installed to a directory outside of sudoers secure_path #5547
Comments
Actually the same thing happens with minikube itself:
That is, anything installed in |
Here is how things work in CentOS: [admin@7d58aaaae462 ~]$ echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/admin/.local/bin:/home/admin/bin
[admin@7d58aaaae462 ~]$ sudo -i
[root@7d58aaaae462 ~]# echo $PATH
/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
[root@7d58aaaae462 ~]# logout
[admin@7d58aaaae462 ~]$ sudo su -
[root@7d58aaaae462 ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
[root@7d58aaaae462 ~]# logout i.e. when using sudo, (Normally "sudo" itself wasn't installed either, but seems to be now...) Tested with:
RH Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1166185 Fedora: https://src.fedoraproject.org/rpms/sudo/blob/f28/f/sudoers Note that |
I wouldn't want to make it the default everywhere, but alternatively, we could use This is definitely not a CentOS only issue, but it's admittedly less common elsewhere. |
sudo crio/crictl
fails if installed to a directory outside of sudoers
secure_path
sudo crio/crictl
fails if installed to a directory outside of sudoers
secure_path
/assign |
@afbjorklund I tried replicating this on CentOS and following two approaches works for me.
Let me know which approach can be good for this issue. |
IIUC The |
I think the plan was to change the sudo invocation in minikube, rather than have the user change... i.e. either do |
We should probably fix this at some point, having a centos machine to test on would help. |
Arguably, the default config is stupid (and indeed, they did fix it for later versions) Most likely we will go with the Problem is that upstream sometimes suggests to use the tarball and /usr/local instead: https://github.com/kubernetes-sigs/cri-tools#install-crictl
The correct way would be to install the rpm package from the kubernetes repositories:
But this gets confusing with minikube, since we use our own binaries for the other three... |
We currently use it from 4 different places (before refactoring, one was hiding in "logs"):
So maybe do a Only difference would be running |
it worked for me too, thanks pro! |
We have some things breaking on CentOS, which does not have
/usr/local/bin
in the PATH.That is: users do have it in their PATH, but root does not. And
sudo
runs with the root PATH.So if you are trying to run something that is not from a package, you will get a "command not found"
This goes both for "crio version" (when run as root) and for "sudo crictl", only work with
/usr/bin
.One workaround is to move everything to
/usr/bin
, which is violating the FHS but whatever.It would be nice if minikube was able to find
crio
andcrictl
- also in their default location ?This would have worked better if crio and cri-tools would be available in the default distribution.
But it doesn't (at the moment), and when you try to install it locally you run into these issues...
The text was updated successfully, but these errors were encountered: