Changes between Version 14 and Version 15 of UserGuide/Service/systemd
- Timestamp:
- 06/05/2017 06:06:17 AM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
UserGuide/Service/systemd
v14 v15 54 54 * 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. 55 55 * 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. 56 57 * 000 grants full access to all accounts. 57 58 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. … … 59 60 Now enable it to start up on boot, start the service and verify it is running: 60 61 {{{ 61 s ystemctl enable /etc/systemd/system/deluged.service62 s ystemctl start deluged63 s ystemctl status deluged62 sudo systemctl enable /etc/systemd/system/deluged.service 63 sudo systemctl start deluged 64 sudo systemctl status deluged 64 65 }}} 65 66 … … 72 73 Now enable it to start up on boot, start the service and verify it is running: 73 74 {{{ 74 s ystemctl enable /etc/systemd/system/deluge-web.service75 s ystemctl start deluge-web76 s ystemctl status deluge-web75 sudo systemctl enable /etc/systemd/system/deluge-web.service 76 sudo systemctl start deluge-web 77 sudo systemctl status deluge-web 77 78 }}} 78 79 … … 97 98 Restart the services: 98 99 {{{ 99 s ystemctl restart deluged100 s ystemctl restart deluge-web100 sudo systemctl restart deluged 101 sudo systemctl restart deluge-web 101 102 }}} 102 103 … … 120 121 121 122 == Start `deluged` only if mount exists == 123 Use this if you have a usb disk drive or network drive that may not be immediately available on boot or disconnected at random. 122 124 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`.125 The 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. 124 126 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: 127 Ensure you have added the correct drive details to `fstab` or equivalent so they are mounted at boot. 128 129 List the available drive mounts: 126 130 {{{ 127 s ystemctl -t mount131 sudo systemctl -t mount 128 132 }}} 129 133 130 Modify the `[Unit]` section of the `deluged.service` script. Changing `xyz.mount` for the mount from the above command: 134 Look 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 136 Modify the `[Unit]` section of the `deluged.service` script. Substitute `xyz.mount` for the mount you want the service to depend on: 131 137 {{{ 132 138 [Unit] 133 139 Description=Deluge Bittorrent Client Daemon 134 # Unit startsafter network and specified mounts are available.140 # Start after network and specified mounts are available. 135 141 After=network-online.target xyz.mount 136 142 Requires=xyz.mount 137 # Unit is stopped when any of these mounts disappear.143 # Stops deluged if mount points disconnect 138 144 BindsTo=xyz.mount 139 145 }}} 140 146 147 For multiple mount points add a space between additional entries. Eg: `After=network-online.target xyz.mount abc.mount def.mount` 148 149 Modify the `[Install]` section to ensure the deluged service is started when the mount point comes back online: 150 {{{ 151 [Install] 152 WantedBy=multi-user.target xyz.mount 153 }}} 154 Note: `WantedBy` seems to work on some distros and not others. Possibly different versions of systemd? 155 141 156 Reference: [https://www.freedesktop.org/software/systemd/man/systemd.unit.html#RequiresMountsFor= systemd.unit]