Neither one kills it gracefully if a torrent is downloading. On reload, it starts checking again!
I tried with both console set on and console set off, but no difference.
From event viewer NSSM events:
Code: Select all
12:04:53 AM Killing process D:\Program Files (x86)\Deluge\deluged.exe because service DELUGE is stopping.
12:05:13 AM kill_process() has waited 20000 of 30000 milliseconds for the DELUGE service to exit. Next update in 10000 milliseconds.
12:05:23 Killing process tree of process 10404 for service DELUGE with exit code 0
12:05:23 Killing PID 10404 in process tree of PID 10404 because service DELUGE is stopping.
From end of debug log of deluged.exe-
Code: Select all
[DEBUG ] 00:04:53 alertmanager:123 dht_reply_alert: (a torrent) () received DHT peers: 15
[DEBUG ] 00:04:54 config:423 Saving new config file C:\Users\ROB\AppData\Roaming\deluge\stats.totals.new
[DEBUG ] 00:04:54 config:436 Backing up old config file to C:\Users\RO\AppData\Roaming\deluge\stats.totals~
[DEBUG ] 00:04:54 config:444 Moving new config file C:\Users\ROB\AppData\Roaming\deluge\stats.totals.new to C:\Users\ROB\AppData\Roaming\deluge\stats.totals..
[DEBUG ] 00:04:55 alertmanager:123 peer_blocked_alert: (a torrent) : blocked peer: 184.108.40.206
[DEBUG ] 00:05:11 alertmanager:123 peer_blocked_alert: (a torrent) : blocked peer: 220.127.116.11
Notice how the kill process was started at 12:04:53 and during that 30 seconds wait, the torrent I had active was still downloading. No indication of stopping torrents, the service, or pausing them! Process was finally killed (I believe by the terminate final option of nssm)- at 12:05:23
In the debug log, we see that it saves the configs around the time of requested shutdown, but still on reload, it did recheck.
In contrast, if I use AlwaysUP, with a setting to use the command "(path\to)deluge-console.exe halt" as the shutdown command, there is no recheck, and I can see that the traffic slows to a halt, then deluged.exe dissapears from task manager.
You can see in the log (which is too long to post easily) that it checks each torrent state, pauses it and saves the state. Also other processes are closed and checked. On restart, it resumes fine!
So, deluge-console.exe halt seems to be the correct way to end deluged.exe, because when downloading a torrent, NSSM will not properly kill it and it will end up rechecking next run.
And before posting this I tried a 60 second run in NSSM, same thing!
By the way, any way to have the deluge client reconnect automatically for xx times every xx seconds?