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

Fix handling of installation prefix so that we don’t use /usr under the prefix. #14661

Closed
wants to merge 3 commits into from

Conversation

Ferroin
Copy link
Member

@Ferroin Ferroin commented Mar 3, 2023

Summary

If installing to a prefix, we should not be using /usr inside that prefix. Doing so causes all kinds of problems and makes things behave in ways users do not expect them to.

Test Plan

This needs verification for both installs and updates on a variety of systems.

Additional Information

Fixes: #13242

This requires special handling around the merge as it is technically a breaking change.

@github-actions github-actions bot added the area/packaging Packaging and operating systems support label Mar 3, 2023
@Ferroin Ferroin marked this pull request as ready for review March 6, 2023 13:02
@Ferroin Ferroin requested a review from tkatsoulas as a code owner March 6, 2023 13:02
@Ferroin Ferroin requested a review from a team March 6, 2023 13:02
Copy link
Contributor

@Dim-P Dim-P left a comment

Choose a reason for hiding this comment

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

Should this:

if [ -x "${NETDATA_PREFIX}/usr/libexec/netdata-switch-dashboard.sh" ]; then
"${NETDATA_PREFIX}/usr/libexec/netdata-switch-dashboard.sh" classic

and also this:

netdata/netdata-installer.sh

Lines 1456 to 1458 in 5319b43

if [ -f "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/go.d.plugin" ]; then
if command -v setcap 1>/dev/null 2>&1; then
run setcap "cap_net_admin+epi cap_net_raw=eip" "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/go.d.plugin"

be changed to NETDATA_LIBEXECDIR as well?

It generally works OK so far, but I want to do some more testing before approving it.

@Ferroin
Copy link
Member Author

Ferroin commented Mar 27, 2023

Should this:

if [ -x "${NETDATA_PREFIX}/usr/libexec/netdata-switch-dashboard.sh" ]; then
"${NETDATA_PREFIX}/usr/libexec/netdata-switch-dashboard.sh" classic

and also this:

netdata/netdata-installer.sh

Lines 1456 to 1458 in 5319b43

if [ -f "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/go.d.plugin" ]; then
if command -v setcap 1>/dev/null 2>&1; then
run setcap "cap_net_admin+epi cap_net_raw=eip" "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/go.d.plugin"

be changed to NETDATA_LIBEXECDIR as well?

The first case needs to stay as-is (it’s there as a compatibility hack, though it can probably be removed at some point in the near future).

The second case does actually need updated though, not sure how I missed it.

@Ferroin
Copy link
Member Author

Ferroin commented Mar 27, 2023

Rebased to pick up CI changes.

@Ferroin Ferroin marked this pull request as draft April 5, 2023 10:55
@Ferroin
Copy link
Member Author

Ferroin commented Apr 5, 2023

Converting this to a draft because it still needs more work.

@Dim-P
Copy link
Contributor

Dim-P commented Apr 6, 2023

@Ferroin How are you planning to handle existing installs?

@Ferroin
Copy link
Member Author

Ferroin commented Apr 6, 2023

@Ferroin How are you planning to handle existing installs?

Handling of that is part of the reason this got switched to be a draft again. I’m trying to come up with a good solution for preserving the existing paths there (and ideally also a migration path for static installs, but that will probably be a separate PR from this one).

@Ferroin
Copy link
Member Author

Ferroin commented Apr 7, 2023

Rebased to pick up CI fixes.

@Ferroin
Copy link
Member Author

Ferroin commented May 30, 2023

Rebased to resolve merge conflicts.

@Ferroin
Copy link
Member Author

Ferroin commented Apr 1, 2024

Closing in favor of #17308

@Ferroin Ferroin closed this Apr 1, 2024
@Ferroin Ferroin deleted the install-prefix-fix branch April 1, 2024 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/packaging Packaging and operating systems support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Building with --prefix=/foo installs files to /foo/usr when it should not do so.
2 participants