mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 11:35:49 +00:00
Fix #1071 issue where Deluge will fail to start if there is a stale ipc lockfile
This commit is contained in:
parent
5f4b39aeb8
commit
aa5f69b203
2 changed files with 15 additions and 1 deletions
|
@ -7,6 +7,7 @@
|
|||
* Fix adding torrents from the Queued Torrents dialog
|
||||
* Fix disabling/enabling plugins after switching daemons
|
||||
* Reduce height of Add Torrent Dialog by ~80 pixels
|
||||
* Fix issue where Deluge will fail to start if there is a stale ipc lockfile
|
||||
|
||||
==== Web ====
|
||||
* Fix installing the deluge-web manpage
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
|
||||
import sys
|
||||
import os.path
|
||||
import os
|
||||
import base64
|
||||
|
||||
import deluge.rencode
|
||||
|
@ -104,6 +104,19 @@ class IPCInterface(component.Component):
|
|||
reactor.run()
|
||||
sys.exit(0)
|
||||
else:
|
||||
lockfile = socket + ".lock"
|
||||
log.debug("Checking if lockfile exists: %s", lockfile)
|
||||
if os.path.lexists(lockfile):
|
||||
try:
|
||||
os.kill(int(os.readlink(lockfile)), 0)
|
||||
except OSError:
|
||||
log.debug("Removing lockfile since it's stale.")
|
||||
try:
|
||||
os.remove(lockfile)
|
||||
os.remove(socket)
|
||||
except Exception, e:
|
||||
log.error("Problem deleting lockfile or socket file!")
|
||||
log.exception(e)
|
||||
try:
|
||||
self.factory = Factory()
|
||||
self.factory.protocol = IPCProtocolServer
|
||||
|
|
Loading…
Add table
Reference in a new issue