FS#11984 - [Deluge 1.0.3-2]deluged does not stop or kill
Attached to Project:
Arch Linux
Opened by Keerthi (keerthi) - Tuesday, 04 November 2008, 01:05 GMT
Last edited by Hugo Doria (hdoria) - Friday, 05 December 2008, 15:08 GMT
Opened by Keerthi (keerthi) - Tuesday, 04 November 2008, 01:05 GMT
Last edited by Hugo Doria (hdoria) - Friday, 05 December 2008, 15:08 GMT
|
Details
Description:
Deluge daemon does not respond to kill command. Additional info: deluge 1.0.3-2 Steps to reproduce: 1. Run deluge in daemon mode (classic mode is off under preferences). Start using 'deluged'. 2. Have about 4 torrents in the queue. 2 torrents actively downloading. 3. Let the daemon run until the torrents begin downloading. 4. Run 'killall deluged'.( Even tried 'sudo killall deluged') 5. deluged won't stop or kill and download continues [Over time I have noticed mutliple deluged process by running 'top' command, hogging CPU and network] |
This task depends upon
According to faq, deluged should stop with SIGTERM.
It does stop when using SIGKILL but it actually an abrupt kill where deluge will not be able to trap the KILL signal causing 'unclean' shutdown. So SIGTERM is preferred so the application can trap it and shutdown cleanly.
killall -SIGTERM deluged ==> Does not work
killall -SIGKILL deluged ==> Works.
Deluged should stop when using SIGTERM.
killall -SIGKILL deluged is forcing the torrents to perform hash check after restarting the daemon (because it shuts down the daemon abruptly). This is very annoying. Please fix this bug.
In meantime, if someone else find out what's is causing the problem here, let me know.
In /usr/lib/python2.6/site-packages/deluge/component.py, changed the shutdown() function from
[code]
def shutdown(self):
"""Shuts down all components. This should be called when the program
exits so that components can do any necessary clean-up."""
# Stop all components first
self.stop()
for component in self.components.keys():
log.debug("Shutting down component %s..", component)
try:
self.components[component].shutdown()
except Exception, e:
log.debug("Unable to call shutdown(): %s", e)
[/code]
to
[code]
def shutdown(self):
"""Shuts down all components. This should be called when the program
exits so that components can do any necessary clean-up."""
# Stop all components first
self.stop()
for component in self.components.keys():
log.debug("Shutting down component %s..", component)
try:
if self.components[component].get_state() != COMPONENT_STATE.index("Stopped"):
self.components[component].shutdown()
except Exception, e:
log.debug("Unable to call shutdown(): %s", e)
[/code]
The fix is to shutdown a component only if is NOT already Stopped.
if self.components[component].get_state() != COMPONENT_STATE.index("Stopped"):
http://dev.deluge-torrent.org/changeset/4337
But it will be only in 1.0.7:
http://dev.deluge-torrent.org/ticket/598#comment:9
Maybe this patch could be included in the next 1.0.6 package, as suggested in the deluge bugreport.
Please revert the patches applied to component.py. And apply the suggested patches to core.py.