Skip to content

Fix RPM linking logic#52703

Merged
hugoShaka merged 1 commit intomasterfrom
hugo/fix-rpm-linking-logic
Mar 3, 2025
Merged

Fix RPM linking logic#52703
hugoShaka merged 1 commit intomasterfrom
hugo/fix-rpm-linking-logic

Conversation

@hugoShaka
Copy link
Copy Markdown
Contributor

@hugoShaka hugoShaka commented Mar 3, 2025

This PR fixes two RPM issues sharing the same root cause that went undetected until 17.3.0 release.

Issue 1: link-package fails

link-package is supposed to run after we successfully installed teleport, to create symlinks to the teleport system install.

RPM hooks are different than other packages and --after-install runs before the previous package removal. This means the old teleport binary has not been removed yet when we invoke teleport-updater link-package and causes an error.
We cannot just overwrite the binaries because the old package removal will happen an tear down our symlinks.

Docs about RPM scriptlets ordering: https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#ordering

Issue 2: unlink-package invoked on update

The uninstallation scriptlet is invoked after each package upgrade, which unlinks Teleport binaries from the system.

This can be detected by looking at the arguments passed by RPM to the scriptlet: https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_syntax

Workaround

Both issues can be worked around by uninstalling and reinstalling the teleport package.
Because the 17.3.0 package potentially left teleport in a state without binaries after a failed update, we pulled 17.3.0 and are releasing 17.3.1.

Changelog: Fixes two issues in the 17.3.0 RPM causing package upgrades to fail and leading to teleport binaries not being symlinked in /usr/local/bin.
Changelog: On RPM-based distros, 17.3.0 can lead to a failed installation without a working Teleport service. The 17.3.0 RPM was pulled from our CDN. 17.3.1 should be used instead. If you updated to 17.3.0, you should update to 17.3.1.

else
echo "Removing symlinks from Teleport system paths..."
/opt/teleport/system/bin/teleport-update unlink-package || true
fi No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit terminal newline

@hugoShaka hugoShaka requested review from fheinecke and vapopov and removed request for gabrielcorado and nklaassen March 3, 2025 16:25
@hugoShaka
Copy link
Copy Markdown
Contributor Author

Test build cooking here, will merge once we have an artifact and proof that the PR addresses both issues: https://github.com/gravitational/teleport.e/actions/runs/13635559487

@hugoShaka hugoShaka force-pushed the hugo/fix-rpm-linking-logic branch from 9440c81 to 0190f60 Compare March 3, 2025 16:37
@public-teleport-github-review-bot public-teleport-github-review-bot bot removed the request for review from fheinecke March 3, 2025 16:41
Copy link
Copy Markdown
Contributor

@fheinecke fheinecke left a comment

Choose a reason for hiding this comment

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

LGTM

@hugoShaka hugoShaka enabled auto-merge March 3, 2025 17:40
@hugoShaka hugoShaka added this pull request to the merge queue Mar 3, 2025
Merged via the queue into master with commit 6cfeacb Mar 3, 2025
45 checks passed
@hugoShaka hugoShaka deleted the hugo/fix-rpm-linking-logic branch March 3, 2025 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants