Files
firezone/rust/gui-client/src-tauri/linux_package/postinst
Thomas Eizinger 5b60d9d64d fix(gui-client): don't stop service after upgrade on Fedora (#10539)
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.
2025-10-09 23:53:32 +00:00

14 lines
309 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
SERVICE_NAME="firezone-client-tunnel"
# Creates the system group `firezone-client`
sudo systemd-sysusers
echo "Starting and enabling Firezone Tunnel service..."
sudo systemctl daemon-reload
sudo systemctl enable "$SERVICE_NAME"
sudo systemctl restart "$SERVICE_NAME"