Skip to content

Instantly share code, notes, and snippets.

@Jachimo
Created May 27, 2018 05:08
Show Gist options
  • Save Jachimo/3d8fde08f4756241c8d2409749eeebc0 to your computer and use it in GitHub Desktop.
Save Jachimo/3d8fde08f4756241c8d2409749eeebc0 to your computer and use it in GitHub Desktop.
systemd init scripts for running Deluge on Debian 8

These are a couple of files to assist in getting Deluge running as a service (daemon) on Debian 8. There doesn't seem to be much in the way of good documentation for this online right now.

Basically, you want to follow the steps on this page, but use the scripts above, because they have the correct user and group IDs for Debian. Also, ignore the "User Management" section, since that is already done as part of the installation if you use apt-get:

But in case that page goes offline, here's the very short version:

  • Stop the deluged and deluge-web services if they are running
  • Make sure any old init.d scripts for deluged/deluge-web have been deleted or moved out of the SysV init directories
  • Put the deluged.service and deluge-web.service files (above) into /etc/systemd/system
  • Make sure they are both owned by root (chmod root:root deluged.service and similarly for deluge-web.service)
  • Make sure they both have proper permissions (chmod 644 for both files)
  • Run systemctl daemon-reload to pick up the files and load them
  • Run systemctl enable deluged.service (have to be in /etc/systemd/system, otherwise use absolute path)
  • systemctl start deluged
  • systemctl status deluged and check for errors, correct any if found (is it already running?)
  • systemctl enable deluge-web.service
  • systemctl start deluge-web
  • systemctl status deluge-web (again, correct any errors, make sure you aren't running two instances at once!)
  • Connect to localhost:8112 to verify that it is running
[Unit]
Description=Deluge Bittorrent Client Web Interface
Documentation=man:deluge-web
After=network-online.target deluged.service
Wants=deluged.service
[Service]
Type=simple
User=debian-deluged
Group=debian-deluged
UMask=002
# This 5 second delay is necessary on some systems
# to ensure deluged has been fully started
ExecStartPre=/bin/sleep 5
ExecStart=/usr/bin/deluge-web
Restart=on-failure
[Install]
WantedBy=multi-user.target
[Unit]
Description=Deluge Bittorrent Client Daemon
Documentation=man:deluged
After=network-online.target
[Service]
Type=simple
User=debian-deluged
Group=debian-deluged
UMask=002
ExecStart=/usr/bin/deluged -d
#Restart=on-failure
# Time to wait before forcefully stopped.
TimeoutStopSec=300
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment