diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2018-08-31 16:05:34 -0300 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2018-09-04 06:28:44 -0300 |
| commit | 2eb364a5eca602784a493e3e03907755fbf2712c (patch) | |
| tree | 88d4d0e435888779db3038c468f10d31e2a00f51 | |
| parent | 5bfc8867a21b9a38421f8e94e6ea28a860d3ef8a (diff) | |
| download | mullvadvpn-2eb364a5eca602784a493e3e03907755fbf2712c.tar.xz mullvadvpn-2eb364a5eca602784a493e3e03907755fbf2712c.zip | |
Support Upstart init system
| -rw-r--r-- | dist-assets/linux/after-install.sh | 9 | ||||
| -rw-r--r-- | dist-assets/linux/before-remove.sh | 8 | ||||
| -rw-r--r-- | dist-assets/linux/mullvad-daemon.conf | 6 | ||||
| -rw-r--r-- | gui/packages/desktop/electron-builder.yml | 8 |
4 files changed, 25 insertions, 6 deletions
diff --git a/dist-assets/linux/after-install.sh b/dist-assets/linux/after-install.sh index ea03f94c91..fa8e808b08 100644 --- a/dist-assets/linux/after-install.sh +++ b/dist-assets/linux/after-install.sh @@ -1,4 +1,9 @@ #!/usr/bin/env bash set -eu -systemctl enable mullvad-daemon.service -systemctl start mullvad-daemon.service + +if which systemctl &> /dev/null; then + systemctl enable mullvad-daemon.service + systemctl start mullvad-daemon.service +elif /sbin/init --version | grep upstart &> /dev/null; then + start mullvad-daemon +fi diff --git a/dist-assets/linux/before-remove.sh b/dist-assets/linux/before-remove.sh index 01f6083cae..829bb25b1e 100644 --- a/dist-assets/linux/before-remove.sh +++ b/dist-assets/linux/before-remove.sh @@ -1,5 +1,9 @@ #!/usr/bin/env bash set -eu -systemctl stop mullvad-daemon.service -systemctl disable mullvad-daemon.service +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 +fi 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/gui/packages/desktop/electron-builder.yml b/gui/packages/desktop/electron-builder.yml index 3365d9e5ed..229917455d 100644 --- a/gui/packages/desktop/electron-builder.yml +++ b/gui/packages/desktop/electron-builder.yml @@ -113,14 +113,18 @@ linux: deb: fpm: ["--before-remove", "../../../dist-assets/linux/before-remove.sh", "--config-files", "/etc/systemd/system/mullvad-daemon.service", - "../../../dist-assets/linux/mullvad-daemon.service=/etc/systemd/system/"] + "--config-files", "/etc/init/mullvad-daemon.conf", + "../../../dist-assets/linux/mullvad-daemon.service=/etc/systemd/system/", + "../../../dist-assets/linux/mullvad-daemon.conf=/etc/init/"] afterInstall: ../../../dist-assets/linux/after-install.sh afterRemove: ../../../dist-assets/linux/after-remove.sh rpm: fpm: ["--before-remove", "../../../dist-assets/linux/before-remove.sh", "--config-files", "/etc/systemd/system/mullvad-daemon.service", - "../../../dist-assets/linux/mullvad-daemon.service=/etc/systemd/system/"] + "--config-files", "/etc/init/mullvad-daemon.conf", + "../../../dist-assets/linux/mullvad-daemon.service=/etc/systemd/system/", + "../../../dist-assets/linux/mullvad-daemon.conf=/etc/init/"] afterInstall: ../../../dist-assets/linux/after-install.sh afterRemove: ../../../dist-assets/linux/after-remove.sh depends: |
