[Support] binhex - Deluge


Recommended Posts

Really appreciate your reply binhex, thanks alot! Also to you ambipro, so not looking like I'm deranged possibly lol, thank you my friend. 

 

Binhex, as said please dont hesitate let me know if I can help with some testings for you or whatever, of course. 

 

You can easily also without testing add the '-d' switch to deluge-web imho, as not blocking without it in deluge2 and so is an oversight.

 

The peerid spoof I just removed because you're not on dev branch anymore so redundant, but semantics of-course.

 

The really strange approach of '-d &' to deluged, in addition to ' -d' on deluge-web(latter making sense though), is what actually fixes dumb-init issue. Shutdown.sh readded might be better dunno, but you know best obviously.

 

The strange double-resume to deluge-console is a workaround for issue in around 1 out of every 5 times failing intended purpose otherwise(with just the single resume added I mean, which is definitely needed, just not enough always and hence found doubled works for these too). 

 

Just elaborating to save you some time if intended possibly rereading all my blabbings.

 

Appreciate you as said/inferred. 

Edited by mhertz
Link to comment
2 hours ago, mhertz said:

The really strange approach of '-d &' to deluged, in addition to ' -d' on deluge-web(latter making sense though), is what actually fixes dumb-init issue. Shutdown.sh readded might be better dunno, but you know best obviously.

OK been playing with this, so to review your findings and mine, the issue is two-fold:-

 

1. deluged and deluge-web fork (default action), and thus dumb-init sigterm never reaches deluged or deluge-web as they are not child processes of the script.

2. dumb-init does not wait for processes to exit after the process is sent sigterm.

 

To fix 1. we simply prevent deluged and deluge-web from running daemonised (but we do background deluged), this then ensures the process is run as a child process of the script and thus gets sent sigterm - see https://github.com/binhex/arch-deluge/commit/8117d7e6286d41f2de6a3a3f35004367b3a432ef

To fix 2. i have to create a script which traps sigterm and then waits for all child processes to exit - see https://github.com/binhex/scripts/blob/master/shell/arch/docker/waitproc.sh

 

Once these two are in place then you can tick and untick plugins and this state is saved, i havent looked at torrent states so i will leave that up to you guys, but it should also fix this.

 

To test please pull down the image with tag name 'wait-proc' please let me know if it works as i will need to merge into master/main if its good - note this is JUST for arch-deluge so far, so arch-delugevpn does NOT have this tag.

Link to comment

Alright can test this out right now.

 

Just to reiterate, as I use 1.x libtorrent (which also has 1.2.19, https://pypi.org/project/libtorrent/#history) - and would love to see this and libtorrent updated in both tags when you merge and build the new images.

 

I don't have an issue testing whatever libtorrent version you're using on this branch by the way :P Just reminding :)

 

I'll setup a new container with that tag, and test what I've found the most reproducible steps are....just so you can replicate if desired, I'll be doing the following expecting it to work rather than fail.

 

1. New instance of Deluge with empty appdata /config dir

2. Attempt to enable ltConfig plugin (version doesn't seem to matter but we keep an updated version on our forums https://forum.deluge-torrent.org/viewtopic.php?p=236641#p236641) - Default plugins didn't seem to consistently fail to remain loaded for whatever under-the-hood reason.

3. Enable the plug-in in Deluge

4. Restart the container through the unraid UI

 

Plugin should be disabled if the fix hasn't worked....otherwise it should remain (if memory serves).

 

I'll post back when I've done this, if it fails or ungraceful shutdown in logs, will post deluged logs.

 

For clarity, I'm using thin-client to do all of this.

 

 

Link to comment
07:44:18 [DEBUG   ][deluge.core.daemon            :1622] Remove pid file: /config/deluged.pid
07:44:18 [INFO    ][deluge.core.daemon            :1622] Deluge daemon shutdown successfully
07:44:18 [INFO    ][deluge.core.daemon_entry      :1622] Exiting...

 

deluged exited successfully.

 

07:44:18 [INFO    ][deluge.ui.web.server       :1622] Shutting down webserver
07:44:18 [DEBUG   ][deluge.ui.web.server       :1622] Saving configuration file

 

For thoroughness here is deluge-web.

 

2023-11-13 07:49:28,099 DEBG fd 8 closed, stopped monitoring <POutputDispatcher at 22393937543568 for <Subprocess at 22393936472720 with name deluge-script in state RUNNING> (stdout)>
2023-11-13 07:49:28,099 DEBG fd 10 closed, stopped monitoring <POutputDispatcher at 22393936863952 for <Subprocess at 22393936472720 with name deluge-script in state RUNNING> (stderr)>
2023-11-13 07:49:28,099 INFO exited: deluge-script (exit status 0; expected)
2023-11-13 07:49:28,100 DEBG received SIGCHLD indicating a child quit
2023-11-13 07:49:46,117 WARN received SIGTERM indicating exit request

 

and Docker logs from when container was stopped

 

Plugins persisted as well.

 

I did go back and test the old image under same conditions (empty config folder). These lines were missing from the logs when the container was stopped, but plugins intermittently did persist regardless. It may not be as consistent as I originally thought to reproduce that way, however it also may have something to do with there being no torrents present and deluged basically being idle throughout the test.

 

Either way, the logs clearly show success in receiving SIGTERM, and waiting for the child processes to return status before container is stopped.

 

I call this a success unless I'm missing something or it reacts differently with torrents loaded (I don't believe it would)

 

 

Edited by ambipro
typo
  • Like 1
Link to comment

I just finished testing now and as ambipro, amazing work, thanks alot binhex, everything up to snuff now as said, state and plugins both, perfection!

 

Ahh so that's why the backgrounding works, never understood that, thanks for elaborating.

 

Last, just have to apologize and kicking myself mentallly because I can't explain it, but my fix today didn't work for whatever reason, and as you found - thanks for being kind about it, appreciated! I reinstalled image before trying today, and i'm guessing in about 100 tries before it worked with mine and failed vanilla, except now and one single time previously where I reinstalled docker image as thought made mistake somehow. Now it continually didn't work in like 20 tries, reinstalled and rebooted and quadrouple-checked everything lol, so feel like a moron, and really sorry, wish I could explain why happened such, just for myself's sanity, but obviously irrelevant and again, beatifull work and thank you so much!

 

Edit: Now my fix works again, but see intermittently, so cannot understand how could be so "lucky" as worked so many times, and not without, but whatever, thanks alot again binhex.

 

 

Edited by mhertz
  • Like 1
Link to comment
21 hours ago, ambipro said:

No pressure, but I was just curious about when you were going to build and push the dumb-init fix and hopefully update libtorrent (dont forget 1.2.19 in libtorrentv1 branch :D) in the docker images?

 

I assume that the fix worked out how you hoped?

 

Just a curious :)

done, please pull down 'latest' tagged image.

Link to comment

Hello there,

 

I don't want to disturb Your actual problem/testing here, but Id like to ask is there any possibility to start/stop specific number of torrents, at specific hours?
I have cache ssd to hdd type of share configured, and Id want to stop all (earlier moved to HDD) data for a 6 hours, on every night, BUT I would like all torrents that are currently on the cache ssd drive to be active all the time. AND each torrent added (via autobrr, for example) was also downloaded and seeded (because it is on the cache ssd drive)

 

is something like this possible on binhex deluge v2? If so, than how could I manage to do that?

 

thank You

Link to comment
24 minutes ago, rogales said:

Hello there,

 

I don't want to disturb Your actual problem/testing here, but Id like to ask is there any possibility to start/stop specific number of torrents, at specific hours?
I have cache ssd to hdd type of share configured, and Id want to stop all (earlier moved to HDD) data for a 6 hours, on every night, BUT I would like all torrents that are currently on the cache ssd drive to be active all the time. AND each torrent added (via autobrr, for example) was also downloaded and seeded (because it is on the cache ssd drive)

 

is something like this possible on binhex deluge v2? If so, than how could I manage to do that?

 

thank You

I don't want to hijack this thread....but I've written a script for unRAID, and written the guide for it, to do what I assume your end goal is.

 

https://github.com/zakkarry/deluge-mover

 

https://trash-guides.info/Downloaders/Deluge/Tips/Unraid-Mover/ for the detailed guide. I'm working on updating it to be current with the scripts configuration options I've added just today, but it should be fairly simple for you to set up as it sits.

Edited by ambipro
quote
Link to comment
  • 2 weeks later...

Hey Guys

not sure if this is the right place to post or not, but I have been using the BinHex version of deluge for a few weeks/months now and its been working absolutely fine.
Though over the last few days its stopped downloading any files, no matter from any trackers. I haven't changed any of the config so I'm not sure what's happened, there's no errors in the error log either.

I have reinstalled the docker image and of course rebooted Unraid as well.

 

Any help would be greatly appreciated.

Link to comment
9 minutes ago, terrorc0j said:

Hey Guys

not sure if this is the right place to post or not, but I have been using the BinHex version of deluge for a few weeks/months now and its been working absolutely fine.
Though over the last few days its stopped downloading any files, no matter from any trackers. I haven't changed any of the config so I'm not sure what's happened, there's no errors in the error log either.

I have reinstalled the docker image and of course rebooted Unraid as well.

 

Any help would be greatly appreciated.

image.png.8da492958385ab17a37206573eeb8a18.png

 

How Your settings look here?

Link to comment
  • 3 weeks later...

always download 0 %

 

Hello everyone. 
I am setting up the new NAS with UNRAID. It is a "small" machine with low power consumption. I opted for a machine with a lot of cache (2x4T in raid1) 4Tb to allow the disks to stand-by as much as possible 

The machine is this one and I installed these dockers
image.thumb.png.290cf3d528ddc779309d929eb36eeadf.png 

With some swearing I get all the dockers working but deluge
seems to work perfectly but the download of any file remains at 0 (image 2)

image.thumb.png.69eb5157fcb6cf78e75b81c7fa9cb9e3.png

 

I check the paths ... all fine
(image 3-4-5)

image.png.be01adb63a6ad97fc79fb53c03888ba3.png

 

image.thumb.png.c7f109c2f35276f29a8ddeb29f35abd6.png

 

image.thumb.png.e064afa73046ab0fbb074b4ec21b9264.png

Especially since the file ".torrent" is written in the correct folder ... so ... it's all correct isn't it!?!
image.thumb.png.72f9c8aebb8dd03fa13c4a3d9e648c0c.png


I set the docker log level to debug and there is absolutely nothing 

supervisord.logdeluge-web.logdeluged.log

 

Guys I don't know what to do anymore.

Thanks in advance

 

Link to comment
7 hours ago, axafax said:

Guys I don't know what to do anymore.

so on the unraid host do you have a path /mnt/user/Archivio/torrent/scaricamento ? because that is what you have in effect defined in deluge web ui by specifying /data/scaricamento, same question for /mnt/user/Archivio/torrent/completi

 

i see the screenshots above but its not 100% clear whether these paths do exist or not.

 

A debug idea - temporarily set completed folder to /tmp (will cause the download to be written to the containers filesystem), if the download starts then the issue is path and/or permissions related.

Link to comment

In the meantime, thank you.
I confirm that the folders exist (in this image you can also see the absolute path)

 

image.thumb.png.f456637328a624276e63e096879f8583.png

 

 

 

I tried using the tmp folder.
I tried both setting the /data variable and the absolute path.

Always the same behaviour

 

 

image.thumb.png.2fbd0c6bb32ee4cf5908e6fa3aa20620.png

 

image.thumb.png.314601cefe527d15d70279408b347609.png

 

is it possible there are some bugs?
should I try using an earlier version?

Thanks again

 

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.