diff options
| author | Emīls Piņķis <emils@mullvad.net> | 2018-11-13 13:04:53 +0000 |
|---|---|---|
| committer | Emīls Piņķis <emils@mullvad.net> | 2018-11-13 13:04:53 +0000 |
| commit | b4e404b92629956a7f1a31060a1db008f430ebec (patch) | |
| tree | d861ee50c4e9e655fcc8e27ff615a8c630eddad6 | |
| parent | d6d0b170290c6f8aff4fcf39e7b68872313eafad (diff) | |
| parent | f631eaab1e7d745e3a97ac7f3b8ffa64011951bd (diff) | |
| download | mullvadvpn-b4e404b92629956a7f1a31060a1db008f430ebec.tar.xz mullvadvpn-b4e404b92629956a7f1a31060a1db008f430ebec.zip | |
Merge branch 'fix-rpm-packaging'
| -rw-r--r-- | CHANGELOG.md | 3 | ||||
| -rw-r--r-- | dist-assets/linux/before-remove.sh | 12 | ||||
| -rw-r--r-- | dist-assets/linux/post-transaction.sh | 6 | ||||
| -rwxr-xr-x | gui/packages/desktop/electron-builder.yml | 1 |
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/", |
