[Packaging] Add systemd user services

Files should be installed into /usr/lib/systemd/user/

Unlike the existing service file, this one configures deluge to run as a
desktop session user. The difference between the services files is the
use of multi-user.target in system service which does not exist for user
services so requires default.target.

Including the Slice indicates to the service manager that this is a
background service. This can be used to handle OOM situations, or
prioritising foreground processes. There's no equivalent for system
services.

Refs: https://dev.deluge-torrent.org/ticket/2034
Closes: https://github.com/deluge-torrent/deluge/pull/380
This commit is contained in:
Hugo Osvaldo Barrera 2022-02-23 00:13:47 +01:00 committed by Calum Lind
parent c89a366dfb
commit 2962f7cd2c
No known key found for this signature in database
GPG Key ID: 90597A687B836BA3
3 changed files with 30 additions and 1 deletions

View File

@ -1,7 +1,7 @@
[Unit] [Unit]
Description=Deluge Bittorrent Client Web Interface Description=Deluge Bittorrent Client Web Interface
Documentation=man:deluge-web Documentation=man:deluge-web
After=network-online.target deluged.service After=deluged.service
Wants=deluged.service Wants=deluged.service
[Service] [Service]

View File

@ -0,0 +1,16 @@
[Unit]
Description=Deluge Bittorrent Client Web Interface
Documentation=man:deluge-web
After=deluged.service
Wants=deluged.service
[Service]
UMask=027
ExecStart=/usr/bin/deluge-web -d
Restart=on-failure
Slice=background.slice
[Install]
WantedBy=default.target

View File

@ -0,0 +1,13 @@
[Unit]
Description=Deluge Bittorrent Client Daemon
Documentation=man:deluged
[Service]
UMask=007
ExecStart=/usr/bin/deluged -d
Restart=on-failure
TimeoutStopSec=300
Slice=background.slice
[Install]
WantedBy=default.target