summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md3
-rw-r--r--dist-assets/linux/before-remove.sh12
-rw-r--r--dist-assets/linux/post-transaction.sh6
-rwxr-xr-xgui/packages/desktop/electron-builder.yml1
4 files changed, 20 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 46a22cdc87..a45cd22e46 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -39,6 +39,9 @@ Line wrap the file at 100 chars. Th
#### Windows
- Use proper app id in the registry. This avoids false-positives with certain anti-virus software.
+#### Linux
+- Improve packaging on RPM based distros by re-enabling the daemon after an upgrade
+
## [2018.5-beta1] - 2018-11-12
### Added
diff --git a/dist-assets/linux/before-remove.sh b/dist-assets/linux/before-remove.sh
index 7ed49f1f78..7fcd1c0715 100644
--- a/dist-assets/linux/before-remove.sh
+++ b/dist-assets/linux/before-remove.sh
@@ -1,9 +1,17 @@
#!/usr/bin/env bash
set -eu
+# Check if we're running during an upgrade step on Fedora
+# https://fedoraproject.org/wiki/Packaging:Scriptlets#Syntax
+if [ $1 -gt 0 ]; then
+ echo not running
+ exit 0;
+fi
+
if which systemctl &> /dev/null; then
- systemctl stop mullvad-daemon.service
- systemctl disable mullvad-daemon.service
+ # the user might've disabled or stopped the service themselves already
+ systemctl stop mullvad-daemon.service || true
+ systemctl disable mullvad-daemon.service || true
elif /sbin/init --version | grep upstart &> /dev/null; then
stop mullvad-daemon
rm -f /etc/init/mullvad-daemon.conf
diff --git a/dist-assets/linux/post-transaction.sh b/dist-assets/linux/post-transaction.sh
new file mode 100644
index 0000000000..78c5115f6f
--- /dev/null
+++ b/dist-assets/linux/post-transaction.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+# This is to mitigate post-uninstall hooks being ran AFTER post-install hooks
+# during an upgrade on Fedora.
+set -eu
+systemctl enable "/opt/Mullvad VPN/resources/mullvad-daemon.service" || true
+systemctl start mullvad-daemon.service || true
diff --git a/gui/packages/desktop/electron-builder.yml b/gui/packages/desktop/electron-builder.yml
index 570be2a18c..38f2dcf6f9 100755
--- a/gui/packages/desktop/electron-builder.yml
+++ b/gui/packages/desktop/electron-builder.yml
@@ -128,6 +128,7 @@ deb:
rpm:
fpm: ["--before-install", "../../../dist-assets/linux/before-install.sh",
"--before-remove", "../../../dist-assets/linux/before-remove.sh",
+ "--rpm-posttrans", "../../../dist-assets/linux/post-transaction.sh",
"--config-files", "/opt/Mullvad VPN/resources/mullvad-daemon.service",
"--config-files", "/opt/Mullvad VPN/resources/mullvad-daemon.conf",
"../../../target/release/mullvad=/usr/bin/",