[FIX] Torrents error after reboot

Guides and tutorials for various stuff. Posted by DietPi users.
Post Reply
vinanrra
Posts: 10
Joined: Mon Oct 24, 2016 4:57 pm

[FIX] Torrents error after reboot

Post by vinanrra » Wed Sep 04, 2019 12:14 am

First to get mounted devices: systemctl -t mount

Second search your device and switch and edit your /etc/systemd/system/deluged.service

Switch XYZ to ur mount.
[Unit]
Description=Deluge Daemon (DietPi)
Documentation=man:deluged
# Start after network and specified mounts are available.
After=network-online.target XYZ.mount
Requires=XYZ.mount
# Stops deluged if mount points disconnect
BindsTo=XYZ.mount

[Service]
User=debian-deluged
Group=dietpi
UMask=002
ExecStart=/usr/bin/deluged -d -l /var/log/deluged/daemon.log -L warning
Restart=on-failure
TimeoutStopSec=300

[Install]
WantedBy=multi-user.target XYZ.mount
Save and now u will never get again error torrents after reboot.


Source: https://deluge.readthedocs.io/en/latest ... rvice.html

User avatar
MichaIng
Legend
Posts: 1626
Joined: Sat Nov 18, 2017 5:21 pm

Re: [FIX] Torrents error after reboot

Post by MichaIng » Tue Sep 10, 2019 11:22 am

@vinanrra
Many thanks for sharing. How did you add the related mount before?

When using dietpi-drive_manager, an fstab entry is created which "mounts" the drive automatically on boot, earlier then dietpi-services starts Deluge or any other torrent service. I quote "mounts", since actually at least for external drives we add the x-systemd.automount option which places an automount unit. This means the drive is not really mounted automatically, but it should be mounted as fast as the first access to its mountpoint occurs. It is just a guess that Deluge might not like the time delay between the initial access and when the actual mount occurs, since the drive usually needs to spin-up first.

So what you could test instead of editing the systemd unit: Remove the ,x-systemd.automount option from the related mount entry in /etc/fstab.

For network drives btw it is more complicated. We do not add x-systemd.automount for them, but actually in some cases this seems to be required to assure that the mount attempt is not done too early, when network has not yet fully been established.

vinanrra
Posts: 10
Joined: Mon Oct 24, 2016 4:57 pm

Re: [FIX] Torrents error after reboot

Post by vinanrra » Sun Sep 15, 2019 7:40 pm

I added the mount with dietpi-drive_manager and should be like u said, first mount drive and then starts deluge but seems like something happens (dont know what) and isnt going like that, because deluge mark all my torrents (more than 200) with "Error", but with that fix worked like charm.

About remove ,x-systemd.automount i think i will leave like that because i dont like to re-check all torrents again because took me a while.

vinanrra
Posts: 10
Joined: Mon Oct 24, 2016 4:57 pm

Re: [FIX] Torrents error after reboot

Post by vinanrra » Sun Sep 15, 2019 7:41 pm

@MichaIng

Post Reply