From 2d974ff5daa784f5e1f4787d7dbf7598daa2b9e6 Mon Sep 17 00:00:00 2001 From: Amritanshu Agrawal Date: Mon, 13 Mar 2017 08:04:17 +0000 Subject: [PATCH] Update 'pages/02.deluge/default.md' --- pages/02.deluge/default.md | 74 ++++++++++++++++++++++++-------------- 1 file changed, 47 insertions(+), 27 deletions(-) diff --git a/pages/02.deluge/default.md b/pages/02.deluge/default.md index 5d83ff8..2bd6c76 100644 --- a/pages/02.deluge/default.md +++ b/pages/02.deluge/default.md @@ -1,33 +1,43 @@ -# Deluge -### Install +# Deluge (Table of Contents) + * [Install Deluge Daemon and Web UI](#install) + * [Verify Installion](#verify) + * [User Management](#user) + * [Autostart deluged with systemd](#auto) + * [Autostart Web UI with systemd](#webui) + * [Enable Logging](#logging) + * [Enable Log Rotation](#rotation) + * [Finally](#finally) + + +### Install Deluge Daemon and Web UI ```sh $ sudo add-apt-repository ppa:deluge-team/ppa $ sudo apt update $ sudo apt install deluge deluged deluge-web deluge-webui ``` -### Verify Deluge Installion -Ensure Deluge daemon `deluged` and Web UI `deluge-web` are installed. -Use `which deluged` or `which deluge-web` to check installation path. If -they are not installed in the usual `/usr/bin` modify the service -file `ExecStart` lines to point to the correct location (e.g. -`/usr/local/bin/deluged`). -### User Management +### Verify Deluge Installion +Ensure Deluge daemon `deluged` and Web UI `deluge-web` are installed. Use `which deluged` or `which deluge-web` to check installation path. If they are not installed in the usual `/usr/bin` modify the service file `ExecStart` lines to point to the correct location (e.g. `/usr/local/bin/deluged`). + +### User Management For security it is best to run a service with a specific user and group. You can create one using the following command: Add to the `deluge` group any users you wish to be able to easily manage or access files downloaded through Deluge, for example: + ```sh sudo adduser --system --gecos "Deluge Service" --disabled-password --group --home /var/lib/deluge deluge sudo adduser tanshu deluge + ``` -### Autostart with systemd -Create the file `/etc/systemd/system/deluged.service` containing the -following: +### Autostart deluged with systemd +Create the file `/etc/systemd/system/deluged.service` containing the following: + ```sh sudo nano /etc/systemd/system/deluged.service ``` + ``` [Unit] Description=Deluge Bittorrent Client Daemon @@ -41,26 +51,29 @@ Group=deluge UMask=007 ExecStart=/usr/bin/deluged -d -l /var/log/deluge/daemon.log -L warning Restart=on-failure + # Configures the time to wait before service is stopped forcefully. TimeoutStopSec=300 [Install] WantedBy=multi-user.target ``` - Enable the -service with: + +Enable the service with: + ```sh systemctl enable /etc/systemd/system/deluged.service systemctl start deluged systemctl status deluged ``` -## Deluge Web UI (deluge-web) Service -### Autostart with systemd -Create the file `/etc/systemd/system/deluge-web.service` containing the -following: + +### Autostart Web UI with systemd +Create the file `/etc/systemd/system/deluge-web.service` containing the following: + ```sh sudo nano /etc/systemd/system/deluge-web.service ``` + ``` [Unit] Description=Deluge Bittorrent Client Web Interface @@ -78,26 +91,32 @@ Restart=on-failure [Install] WantedBy=multi-user.target ``` + Enable the service with: + ``` systemctl enable /etc/systemd/system/deluge-web.service systemctl start deluge-web systemctl status deluge-web ``` -## Logging -Create a log directory for Deluge and give the service user (e.g. -`deluge`), full access: + +### Logging + +Create a log directory for Deluge and give the service user (e.g. `deluge`), full access: + ```sh $ sudo mkdir -p /var/log/deluge $ sudo chown -R deluge:deluge/var/log/deluge $ sudo chmod -R 750 /var/log/deluge ``` -- The deluge log directory is now configured so that user deluge has -full access, group deluge read only and everyone else denied access. The -umask specified in the services sets the permission of new log files. -See Deluge Logging for all available log-levels. -### Log Rotation + +- The deluge log directory is now configured so that user deluge has full access, group deluge read only and everyone else denied access. The umask specified in the services sets the permission of new log files. +- See Deluge Logging for all available log-levels. + +### Log Rotation + To enable log rotation create `/etc/logrotate.d/deluge` with the following code: + ``` /var/log/deluge/*.log { rotate 4 @@ -113,5 +132,6 @@ To enable log rotation create `/etc/logrotate.d/deluge` with the following code: endscript } ``` -### Open Browser + +### Open Browser `http://localhost:8112`