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

The root path on centos has no /usr/local/bin #345

Merged
merged 2 commits into from Oct 19, 2021

Conversation

afbjorklund
Copy link
Contributor

Closes #343

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
jandubois
jandubois previously approved these changes Oct 18, 2021
Copy link
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -38,5 +38,5 @@ else
# Remove legacy systemd service
rm -f "/home/${LIMA_CIDATA_USER}.linux/.config/systemd/user/lima-guestagent.service"

sudo lima-guestagent install-systemd
sudo /usr/local/bin/lima-guestagent install-systemd
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rather modify $PATH globally?

containerd installer needs /usr/local/bin too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really sure why containerd doesn't use /usr, but maybe it is related to not using packages ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason it seems like the CentOS containers have it in the path, but not the CentOS VMs ? Weird.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is actually sudo that is dropping it, if you log in as root then you have the /usr/local in there as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, that was only /usr/local/sbin - there is still no /usr/local/bin in the PATH for root. Only /root/bin.

@afbjorklund
Copy link
Contributor Author

It seems like the containerd installer wasn't happy with just an absolute path...

[ERROR] containerd-rootless.sh needs to be present under $PATH

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
@afbjorklund
Copy link
Contributor Author

afbjorklund commented Oct 18, 2021

Interestingly, this also means that sudo nerdctl fails. Forgot how painful CentOS is...

sudo: nerdctl: command not found (the workaround is /usr/local/bin/nerdctl. eww)

@AkihiroSuda AkihiroSuda added the guest/el8 Guest: CentOS 8 / Rocky Linux 8 / Alma Linux 8 label Oct 19, 2021
@AkihiroSuda AkihiroSuda marked this pull request as draft October 19, 2021 04:03
@AkihiroSuda AkihiroSuda marked this pull request as ready for review October 19, 2021 04:04
@AkihiroSuda AkihiroSuda added this to the v0.7.2 milestone Oct 19, 2021
@AkihiroSuda
Copy link
Member

Is this mergeable or still WIP?

@jandubois
Copy link
Member

Is this mergeable or still WIP?

I believe it is mergeable now if you are happy with the sudo ... "PATH=${PATH}" ... way of setting PATH for the containerd installer.

I think sudo ... --preserve-env=PATH ... is more idiomatic, but don't really care, as the result will be the same.

@afbjorklund
Copy link
Contributor Author

Works too:

[anders@lima-centos anders]$ which lima-guestagent
/usr/local/bin/lima-guestagent
[anders@lima-centos anders]$ sudo --preserve-env=PATH which lima-guestagent
/usr/local/bin/lima-guestagent

@AkihiroSuda AkihiroSuda merged commit 39e6b86 into lima-vm:master Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guest/el8 Guest: CentOS 8 / Rocky Linux 8 / Alma Linux 8
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Running lima-guestagent fails on CentOS
3 participants