diff options
| -rw-r--r-- | CHANGELOG.md | 3 | ||||
| -rw-r--r-- | dist-assets/linux/after-install.sh | 11 | ||||
| -rw-r--r-- | dist-assets/linux/after-remove.sh | 31 | ||||
| -rw-r--r-- | dist-assets/linux/before-install.sh | 9 | ||||
| -rw-r--r-- | dist-assets/linux/before-remove.sh | 10 | ||||
| -rw-r--r-- | dist-assets/linux/install_script.sh | 4 | ||||
| -rw-r--r-- | dist-assets/linux/mullvad-daemon.conf | 6 | ||||
| -rw-r--r-- | dist-assets/linux/mullvad-daemon.service | 2 | ||||
| -rw-r--r-- | dist-assets/linux/uninstall_script.sh | 40 | ||||
| -rw-r--r-- | gui/packages/desktop/electron-builder.yml | 24 |
10 files changed, 88 insertions, 52 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index e78c30f784..707d6413d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ Line wrap the file at 100 chars. Th - Warn in the Settings screen if a new version is available. - Enter a "blocked" state in case of connection error, which prevents leaking connections until the user specifically requests to disconnect. +- Add support for Ubuntu 14.04 and other distributions that use the Upstart init system. #### Windows - Extend uninstaller to also remove logs, cache and optionally settings. @@ -38,6 +39,8 @@ Line wrap the file at 100 chars. Th #### Linux - The app window is now shown in its previous location, instead of at the center of the screen. +- Remove daemon log, cache and configuration directories during full uninstallation of the app. +- Restart the daemon automatically on upgrade. #### macOS - Fix edge cases when window's arrow appeared misaligned and pointed to the wrong menubar item. diff --git a/dist-assets/linux/after-install.sh b/dist-assets/linux/after-install.sh new file mode 100644 index 0000000000..0abe49cbe5 --- /dev/null +++ b/dist-assets/linux/after-install.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -eu + +if which systemctl &> /dev/null; then + systemctl enable "/opt/Mullvad VPN/resources/mullvad-daemon.service" + systemctl start mullvad-daemon.service +elif /sbin/init --version | grep upstart &> /dev/null; then + ln -s "/opt/Mullvad VPN/resources/mullvad-daemon.conf" /etc/init/ + initctl reload-configuration + start mullvad-daemon +fi diff --git a/dist-assets/linux/after-remove.sh b/dist-assets/linux/after-remove.sh new file mode 100644 index 0000000000..730445448f --- /dev/null +++ b/dist-assets/linux/after-remove.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +set -eu + +function remove_logs_and_cache { + rm -rf /var/log/mullvad-vpn/ || \ + echo "Failed to remove mullvad-vpn logs" + rm -rf /var/cache/mullvad-vpn/ || \ + echo "Failed to remove mullvad-vpn cache" +} + +function remove_config { + rm -rf /etc/mullvad-vpn || \ + echo "Failed to remove mullvad-vpn config" +} + +# checking what kind of an action is taking place +case $@ in + # apt purge passes "purge" + "purge") + remove_logs_and_cache + remove_config + ;; + # apt remove passes "remove" + "remove") + ;; + # yum remove passes a 0 + "0") + remove_logs_and_cache + remove_config + ;; +esac diff --git a/dist-assets/linux/before-install.sh b/dist-assets/linux/before-install.sh new file mode 100644 index 0000000000..2c940688b2 --- /dev/null +++ b/dist-assets/linux/before-install.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -eu + +if which systemctl &> /dev/null; then + if systemctl status mullvad-daemon &> /dev/null; then + systemctl stop mullvad-daemon.service + systemctl disable mullvad-daemon.service + fi +fi diff --git a/dist-assets/linux/before-remove.sh b/dist-assets/linux/before-remove.sh new file mode 100644 index 0000000000..7ed49f1f78 --- /dev/null +++ b/dist-assets/linux/before-remove.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -eu + +if which systemctl &> /dev/null; then + systemctl stop mullvad-daemon.service + systemctl disable mullvad-daemon.service +elif /sbin/init --version | grep upstart &> /dev/null; then + stop mullvad-daemon + rm -f /etc/init/mullvad-daemon.conf +fi diff --git a/dist-assets/linux/install_script.sh b/dist-assets/linux/install_script.sh deleted file mode 100644 index ea03f94c91..0000000000 --- a/dist-assets/linux/install_script.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -set -eu -systemctl enable mullvad-daemon.service -systemctl start mullvad-daemon.service diff --git a/dist-assets/linux/mullvad-daemon.conf b/dist-assets/linux/mullvad-daemon.conf new file mode 100644 index 0000000000..70bb4b624c --- /dev/null +++ b/dist-assets/linux/mullvad-daemon.conf @@ -0,0 +1,6 @@ +# Upstart job configuration file for the Mullvad VPN daemon + +start on local-filesystems and net-device-up IFACE!=lo +respawn +chdir /opt/Mullvad\ VPN/resources +exec /opt/Mullvad\ VPN/resources/mullvad-daemon -v diff --git a/dist-assets/linux/mullvad-daemon.service b/dist-assets/linux/mullvad-daemon.service index 035ee66f46..62d9c7175a 100644 --- a/dist-assets/linux/mullvad-daemon.service +++ b/dist-assets/linux/mullvad-daemon.service @@ -1,3 +1,5 @@ +# Systemd service unit file for the Mullvad VPN daemon + [Unit] Description=Mullvad VPN daemon Wants=network.target diff --git a/dist-assets/linux/uninstall_script.sh b/dist-assets/linux/uninstall_script.sh deleted file mode 100644 index b4f4671b92..0000000000 --- a/dist-assets/linux/uninstall_script.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash -set -eu - -function remove_systemd_unit { - systemctl stop mullvad-daemon.service || \ - echo "Failed to stop mullvad-daemon service" - systemctl disable mullvad-daemon.service || \ - echo "Failed to disable mullvad-daemon service" -} - -function remove_logs_and_cache { - rm -rf /var/log/mullvad-daemon/ || \ - echo "Failed to remove mullvad-daemon logs" - rm -rf /var/cache/mullvad-daemon/ || \ - echo "Failed to remove mullvad-daemon cache" -} - -function remove_config { - rm -rf /etc/mullvad-daemon || \ - echo "Failed to remove mullvad-daemon config" -} - -# checking what kind of an action is taking place -case $@ in - # apt purge passes "purge" - "purge") - remove_logs_and_cache - remove_config - ;; - # apt remove passes "remove" - "remove") - remove_systemd_unit - ;; - # yum remove passes a 0 - "0") - remove_logs_and_cache - remove_systemd_unit - remove_config - ;; -esac diff --git a/gui/packages/desktop/electron-builder.yml b/gui/packages/desktop/electron-builder.yml index 144144cca9..e94bdb0d13 100644 --- a/gui/packages/desktop/electron-builder.yml +++ b/gui/packages/desktop/electron-builder.yml @@ -109,18 +109,26 @@ linux: to: . - from: ../../../dist-assets/binaries/linux/openvpn to: . + - from: ../../../dist-assets/linux/mullvad-daemon.conf + to: . + - from: ../../../dist-assets/linux/mullvad-daemon.service + to: . deb: - fpm: ["--config-files", "/etc/systemd/system/mullvad-daemon.service", - "../../../dist-assets/linux/mullvad-daemon.service=/etc/systemd/system/"] - afterInstall: ../../../dist-assets/linux/install_script.sh - afterRemove: ../../../dist-assets/linux/uninstall_script.sh + fpm: ["--before-install", "../../../dist-assets/linux/before-install.sh", + "--before-remove", "../../../dist-assets/linux/before-remove.sh", + "--config-files", "/opt/Mullvad VPN/resources/mullvad-daemon.service", + "--config-files", "/opt/Mullvad VPN/resources/mullvad-daemon.conf"] + afterInstall: ../../../dist-assets/linux/after-install.sh + afterRemove: ../../../dist-assets/linux/after-remove.sh rpm: - fpm: ["--config-files", "/etc/systemd/system/mullvad-daemon.service", - "../../../dist-assets/linux/mullvad-daemon.service=/etc/systemd/system/"] - afterInstall: ../../../dist-assets/linux/install_script.sh - afterRemove: ../../../dist-assets/linux/uninstall_script.sh + fpm: ["--before-install", "../../../dist-assets/linux/before-install.sh", + "--before-remove", "../../../dist-assets/linux/before-remove.sh", + "--config-files", "/opt/Mullvad VPN/resources/mullvad-daemon.service", + "--config-files", "/opt/Mullvad VPN/resources/mullvad-daemon.conf"] + afterInstall: ../../../dist-assets/linux/after-install.sh + afterRemove: ../../../dist-assets/linux/after-remove.sh depends: - libXScrnSaver - libappindicator |
