Gracefully close Deluged?

Specific support for Deluge on Microsoft Windows OS
Post Reply
shenron
New User
New User
Posts: 5
Joined: Sat Aug 25, 2012 7:03 pm

Gracefully close Deluged?

Post by shenron »

Hey all,

I am running DelugeD on Windows home server 2011, and so far it seems to be working great. I was not able to get it to work as a service (the process would be running, but no thin clients could connect to it), so I have it set up to run as a user on boot using a startup trigger.

My issue is that when the computer is shutdown for any reason, the process does not terminate gracefully, resulting in recheck every single time the program comes back up. Is there anyway to make sure that deluged terminates gracefully before the server reboots? It reboots automatically based off of other triggers in programs, so I dont have a set schedule or any easy way of predicting reboot times. Please let me know if there is anyway to make sure that the daemon closes gracefully before the machine goes down. Thanks!
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Gracefully close Deluged?

Post by Cas »

My initial thought were that it might be too many torrents prevently deluged exiting nicely. However I just found that apparently there is no handling in Windows 7 (assume same as WHS'11) for SetConsoleCtrlHandler which waits for CTRL_SHUTDOWN_EVENT.

I found an interesting script to stall shutdown and perform your own clean shutdown: http://stackoverflow.com/questions/1114 ... -kills-all

and another to help with debugging: http://stackoverflow.com/questions/5209 ... 00#2673800

What is interesting about the above link is that it mentions "The application must shutdown within 5 seconds (20 seconds for services)." so in your case deluged has not much time to close gracefully.
shenron
New User
New User
Posts: 5
Joined: Sat Aug 25, 2012 7:03 pm

Re: Gracefully close Deluged?

Post by shenron »

Awesome, thanks for the reply. I'll look into setting up a python install on my box and see how it goes. Thanks for the help, and Ill post back when I get a chance to set up the options as detailed in those two links. Thanks!
Post Reply