Changes between Version 14 and Version 15 of UserGuide/Service/systemd


Ignore:
Timestamp:
06/05/2017 06:06:17 AM (2 months ago)
Author:
delugi
Comment:

Added sudo to commands that were missing them. Added more information to start only if mount exists section

Legend:

Unmodified
Added
Removed
Modified
  • UserGuide/Service/systemd

    v14 v15  
    5454  * 007 grants full access to the user and members of the group deluged is running as (in this case deluge) and prevents access from all other accounts. 
    5555  * 022 grants full access to the user deluged is running as and only read access to other accounts. 
     56  * 002 grants full access to the user and group deluged is running as and only read access to other accounts. 
    5657  * 000 grants full access to all accounts. 
    5758 Refer to [http://en.wikipedia.org/wiki/Umask#Octal_umasks Wikipedia] for details of possible values and their effects. Deluged must be stopped and started instead of just restarted after changes. If you enable logging, as described later in this page, the umasks specified here also affect the permissions of newly created logs. 
     
    5960Now enable it to start up on boot, start the service and verify it is running: 
    6061{{{ 
    61 systemctl enable /etc/systemd/system/deluged.service 
    62 systemctl start deluged 
    63 systemctl status deluged 
     62sudo systemctl enable /etc/systemd/system/deluged.service 
     63sudo systemctl start deluged 
     64sudo systemctl status deluged 
    6465}}} 
    6566 
     
    7273Now enable it to start up on boot, start the service and verify it is running: 
    7374{{{ 
    74 systemctl enable /etc/systemd/system/deluge-web.service 
    75 systemctl start deluge-web 
    76 systemctl status deluge-web 
     75sudo systemctl enable /etc/systemd/system/deluge-web.service 
     76sudo systemctl start deluge-web 
     77sudo systemctl status deluge-web 
    7778}}} 
    7879 
     
    9798Restart the services: 
    9899{{{ 
    99 systemctl restart deluged 
    100 systemctl restart deluge-web 
     100sudo systemctl restart deluged 
     101sudo systemctl restart deluge-web 
    101102}}} 
    102103 
     
    120121 
    121122== Start `deluged` only if mount exists == 
     123Use this if you have a usb disk drive or network drive that may not be immediately available on boot or disconnected at random. 
    122124 
    123 If you have a usb disk drive or network drive that may not be immediately available to the `deluged`. The following additions wait for those mountpoints before starting `deluged`. 
     125The following additions wait for those mountpoints before starting `deluged`. If they are unmounted or disconnected then `deluged` is stopped. When they become available again `deluged` is started. 
    124126 
    125 Ensure you have added the correct drive details to `fstab` or equivalent so they are mounted at boot. List the available drive mounts like so: 
     127Ensure you have added the correct drive details to `fstab` or equivalent so they are mounted at boot. 
     128 
     129List the available drive mounts: 
    126130{{{ 
    127 systemctl -t mount 
     131sudo systemctl -t mount 
    128132}}} 
    129133 
    130 Modify the `[Unit]` section of the `deluged.service` script. Changing `xyz.mount` for the mount from the above command: 
     134Look for your mount point in the Description column. Mounts are formatted similar to the mount point with - substituted for / in the path. Eg: `media-xyz.mount` 
     135 
     136Modify the `[Unit]` section of the `deluged.service` script. Substitute `xyz.mount` for the mount you want the service to depend on: 
    131137{{{ 
    132138[Unit] 
    133139Description=Deluge Bittorrent Client Daemon 
    134 # Unit starts after network and specified mounts are available. 
     140# Start after network and specified mounts are available. 
    135141After=network-online.target xyz.mount 
    136142Requires=xyz.mount 
    137 # Unit is stopped when any of these mounts disappear. 
     143# Stops deluged if mount points disconnect 
    138144BindsTo=xyz.mount 
    139145}}} 
    140146 
     147For multiple mount points add a space between additional entries. Eg: `After=network-online.target xyz.mount abc.mount def.mount` 
     148 
     149Modify the `[Install]` section to ensure the deluged service is started when the mount point comes back online: 
     150{{{ 
     151[Install] 
     152WantedBy=multi-user.target xyz.mount 
     153}}} 
     154Note: `WantedBy` seems to work on some distros and not others. Possibly different versions of systemd? 
     155 
    141156Reference: [https://www.freedesktop.org/software/systemd/man/systemd.unit.html#RequiresMountsFor= systemd.unit]