Skip to content

fix(gui-client): don't stop service after upgrade on Fedora - #10539

Merged
thomaseizinger merged 2 commits into
mainfrom
fix/no-stop-prerm
Oct 10, 2025
Merged

thomaseizinger merged 2 commits into
mainfrom
fix/no-stop-prerm

Conversation

@thomaseizinger

@thomaseizinger thomaseizinger commented Oct 9, 2025 •

Copy link
Copy Markdown
Member

On Fedora, when a package gets upgraded, the new package is installed first, followed by the uninstall of the old package. As a result, the prerm script is called after the postinst script of the new package.

In our prerm script, we stop the tunnel service. On package upgrades, this results in us stopping the tunnel service after installing the new package, confronting the user with an error that the tunnel service is not running.

rpm passes arguments to these maintenance scripts. In the case of prerm, we receive the count of how many other instances of this packages are installed. To fix this bug, we check whether the first argument to the script is "1", meaning that we are being upgraded and should not stop the tunnel service.

@vercel

vercel Bot commented Oct 9, 2025 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
firezone Ready Ready Preview Comment Oct 9, 2025 11:40pm

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a package upgrade issue where the tunnel service was being unconditionally stopped during package upgrades on Fedora systems. The fix adds conditional logic to only stop the service during actual uninstalls, not upgrades.

Key changes:

  • Added conditional check for package manager arguments to distinguish between upgrades and removals
  • Added error suppression (|| true) to systemctl commands to prevent script failures

@thomaseizinger

Copy link
Copy Markdown
Member Author

This has been bugging me for a while and I couldn't figure out what was wrong for ages! I thought it was just a Fedora thing 🤷

@thomaseizinger

Copy link
Copy Markdown
Member Author

I think it might be more correct to try and detect that we are being upgraded and are on Fedora and then simply early exit.

@thomaseizinger thomaseizinger changed the title fix(gui-client): don't unconditionally stop service in prerm fix(gui-client): don't stop service after upgrade on Fedora Oct 9, 2025
@thomaseizinger
thomaseizinger added this pull request to the merge queue Oct 9, 2025
Merged via the queue into main with commit 5b60d9d Oct 10, 2025
1 check passed
@thomaseizinger
thomaseizinger deleted the fix/no-stop-prerm branch October 10, 2025 00:10

This branch was successfully deployed

1 active deployment
Preview — 6245954c Deployed Oct 9, 2025 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants