From c8ee834b23b81b63c9055a370d9aa2d66a524e68 Mon Sep 17 00:00:00 2001 From: Mikaela Suomalainen Date: Wed, 12 May 2021 22:18:53 +0300 Subject: [PATCH] systemd/user: introduce mullvad-connect.service --- conf/systemd/user/ipfs.service | 3 ++- conf/systemd/user/mullvad-connect.service | 15 +++++++++++++++ conf/systemd/user/qbittorrent-nox.service | 2 ++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 conf/systemd/user/mullvad-connect.service diff --git a/conf/systemd/user/ipfs.service b/conf/systemd/user/ipfs.service index 6ed1e2ce..fd07bd6b 100644 --- a/conf/systemd/user/ipfs.service +++ b/conf/systemd/user/ipfs.service @@ -1,6 +1,7 @@ [Unit] Description=IPFS daemon -After=network.target +After=network.target mullvad-connect.service +Wants=mullvad-connect.service # IMPORTANT! If you are running on a VPS/dedicated/similar # `ipfs init --profile=server` or immediately after setting it up diff --git a/conf/systemd/user/mullvad-connect.service b/conf/systemd/user/mullvad-connect.service new file mode 100644 index 00000000..5bbbd15b --- /dev/null +++ b/conf/systemd/user/mullvad-connect.service @@ -0,0 +1,15 @@ +[Unit] +Description=Connect Mullvad VPN on user login +After=network-online.target dbus.socket +Wants=network-online.target dbus.socket + +[Service] +Type=forking +ExecStartPre=sleep 60 +ExecStart=mullvad connect +# ExecStop runs after forking leading into immediate disconnect! +TimeOutSec=infinity +Restart=on-failure + +[Install] +WantedBy=default.target diff --git a/conf/systemd/user/qbittorrent-nox.service b/conf/systemd/user/qbittorrent-nox.service index 741dc495..3016c209 100644 --- a/conf/systemd/user/qbittorrent-nox.service +++ b/conf/systemd/user/qbittorrent-nox.service @@ -1,5 +1,7 @@ [Unit] Description=A Headless Bittorrent client using rb_libtorrent +After=mullvad-connect.service +Wants=mullvad-connect.service [Service] Type=simple