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

[teleport-update] Add unlink-package command #49250

Merged
merged 6 commits into from
Nov 21, 2024

Conversation

sclevine
Copy link
Member

This PR adds the unlink-package subcommand to the teleport-update command.

This subcommand reverses the linking created in #48712, to support removal of deb/rpm packages.

The link-package subcommand will allow the teleport RPM and DEB packages to co-exist with versions of Teleport that are installed by the teleport-update binary, by ensuring that Teleport binaries installed by the package into /usr/local/teleport-system are always linked to /usr/local when no teleport-update-managed installation is present.

Note that the Teleport package will have its files moved into /usr/local/teleport-system in a future PR. This command is not useful until this packaging change is complete.

The teleport-update binary will be used to enable, disable, and trigger automatic Teleport agent updates. The new auto-updates system manages a local installation of the cluster-specified version of Teleport stored in /var/lib/teleport/versions.

RFD: #47126
Goal (internal): https://github.com/gravitational/cloud/issues/10289

Examples:

ubuntu@legendary-mite:~$ sudo ./teleport-update link-package
2024-11-20T06:40:30Z INFO [UPDATER]   Systemd configuration synced. unit:teleport.service agent/process.go:255
2024-11-20T06:40:30Z INFO [UPDATER]   Successfully linked system package installation. agent/updater.go:718
ubuntu@legendary-mite:~$ ls -la /usr/local/bin/
total 8
drwxr-xr-x  2 root root 4096 Nov 20 06:39 .
drwxr-xr-x 11 root root 4096 Nov 13 01:41 ..
lrwxrwxrwx  1 root root   46 Nov 20 06:39 fdpass-teleport -> /usr/local/teleport-system/bin/fdpass-teleport
lrwxrwxrwx  1 root root   35 Nov 20 06:39 tbot -> /usr/local/teleport-system/bin/tbot
lrwxrwxrwx  1 root root   35 Nov 20 06:39 tctl -> /usr/local/teleport-system/bin/tctl
lrwxrwxrwx  1 root root   39 Nov 20 06:39 teleport -> /usr/local/teleport-system/bin/teleport
lrwxrwxrwx  1 root root   34 Nov 20 06:39 tsh -> /usr/local/teleport-system/bin/tsh
ubuntu@legendary-mite:~$ sudo ./teleport-update unlink-package
2024-11-20T06:41:28Z INFO [UPDATER]   Systemd configuration synced. unit:teleport.service agent/process.go:255
2024-11-20T06:41:28Z INFO [UPDATER]   Successfully unlinked system package installation. agent/updater.go:732
ubuntu@legendary-mite:~$ cat /lib/systemd/system/teleport.service 
cat: /lib/systemd/system/teleport.service: No such file or directory
ubuntu@legendary-mite:~$ ls -la /usr/local/bin/
total 8
drwxr-xr-x  2 root root 4096 Nov 20 06:41 .
drwxr-xr-x 11 root root 4096 Nov 13 01:41 ..

Base automatically changed from sclevine/teleport-update-config to master November 20, 2024 20:31
@sclevine sclevine force-pushed the sclevine/teleport-update-unlink branch from 72985d9 to 2c084cd Compare November 20, 2024 21:32
@sclevine sclevine marked this pull request as ready for review November 20, 2024 21:33
@sclevine sclevine added the no-changelog Indicates that a PR does not require a changelog entry label Nov 20, 2024
lib/autoupdate/agent/installer.go Outdated Show resolved Hide resolved
lib/autoupdate/agent/installer.go Outdated Show resolved Hide resolved
@sclevine sclevine enabled auto-merge November 21, 2024 16:35
@sclevine sclevine added this pull request to the merge queue Nov 21, 2024
Merged via the queue into master with commit 1989776 Nov 21, 2024
39 checks passed
@sclevine sclevine deleted the sclevine/teleport-update-unlink branch November 21, 2024 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Indicates that a PR does not require a changelog entry size/md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants