Gracefully killing deluged in Windows?

Specific support for Deluge on Microsoft Windows OS
galneon
Member
Member
Posts: 24
Joined: Mon May 18, 2015 3:24 pm
OS or Distro: Win10

Gracefully killing deluged in Windows?

Postby galneon » Tue Feb 20, 2018 9:20 pm

Topic says it all. I need to be able to kill deluged on Windows when the daemon is too busy to allow thinclient connections, but without wrecking everything like taskmanager killing it would. There must be a command line method I can use.

Cas
Top Bloke
Top Bloke
Posts: 3474
Joined: Mon Dec 07, 2009 6:04 am
OS or Distro: Ubuntu 16.04
Location: Scotland

Re: Gracefully killing deluged in Windows?

Postby Cas » Thu Feb 22, 2018 9:38 am

If you use taskmanager, I thought it should gracefully kill it, however if the daemon is not allowing connections I am not sure it will respond to graceful kill. For cli command see: https://superuser.com/a/959365

Perhaps take a backup of the state files before killing it, if daemon stops responding.

galneon
Member
Member
Posts: 24
Joined: Mon May 18, 2015 3:24 pm
OS or Distro: Win10

Re: Gracefully killing deluged in Windows?

Postby galneon » Thu Feb 22, 2018 6:53 pm

Taskmanager/logging out of Windows never gracefully kills it in my experience, even when the daemon isn't busy :/ The result is always errored out active downloads, but seldom worse. "Worse" hit the other day which is why I asked if there was an easier way to gracefully kill. Several hundred seeding torrents required rechecking after a reboot (no, logging out/rebooting doesn't generate the standard "this program is keeping Windows from restarting, end task now?" dialogue for deluged so I can't just let it take as long as it likes). After restarting the daemon began allowing connections after about 30 minutes so I was able to connect to see that all these torrents were being rechecked, some of which were gigantic--it would have taken hours. I tried to close it all down via the client using "quit and shutdown daemon", but nothing happened (client and daemon both still up after nearly an hour) because it was too busy to take commands.

I taskmanager-killed both client and daemon, then restored my backed up fastresume/state (I have scheduled tasks backing them up every 4 hours due to prior catastrophes). I restarted the daemon and after around 30 minutes was able to connect only to see it was now downloading around 300 torrents I had previously been seeding (with most of the 300 only queued due to max 10 active downloads). I checked my torrent data and saw that all of the queued torrents which had previously been seeds were now 0 bytes. I killed the daemon again, restored fastresume/state, restored torrent data from a delayed mirror volume, then the daemon ran no problem.

This is the only time I haven't been able to easily restore with an old fastresume/state. Something much worse happened here which zero'd out the file sizes, and stranger yet, it did so improperly. After I restored the torrent data from the mirrored volume, the original volume had ~250 GB less free space reported despite having the same amount of data as the mirror volume. I ran chkdsk /f and it found the misallocated 250 GB and corrected it.

Sorry, log wasn't useful and I wasn't running debug.

This is my favorite client by far, but it still requires significant caution to use, particularly if you are seeding more than a thousand torrents (yes, if you're wondering, the client is extraordinarily sluggish when doing this despite the server being very capable and on gigabit LAN, with my WAN down/up never exceeding 60 Mbps/5 Mbps)... I hope 2.0 offers performance improvements.

Edit: And to add a quote from the superuser thread you linked: "There is no real way to close console applications gracefully on Windows. They need to support some kind of graceful close mechanism." I'll give the taskkill method a try sometime when all my backups are fresh.

galneon
Member
Member
Posts: 24
Joined: Mon May 18, 2015 3:24 pm
OS or Distro: Win10

Re: Gracefully killing deluged in Windows?

Postby galneon » Mon Feb 26, 2018 7:34 pm

Just tested: taskkill /im deluged.exe (as admin) gives a successful message but does nothing. "End task" under Task Manager force-kills (instantly) in a dirty manner. Only clean way to stop the daemon on Windows is through the client. :/A dirty shutdown is often fine if you're not currently downloading/checking anything. At the very least some rechecks are required otherwise, and as outlined above, sometimes much more.


Return to “Windows OS”

Who is online

Users browsing this forum: No registered users and 1 guest