summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2013-11-19 22:11:15 +0000
committerCalum Lind <calumlind+deluge@gmail.com>2013-11-19 22:43:01 +0000
commit7bd87d1a8217024f7447585897152de03242a20b (patch)
tree872b24d9565605ec575a6731a1737b0cdd539d67
parent8bf18d6694db24e04cb65f20f2e219ec14043f8e (diff)
downloaddeluge-7bd87d1a8217024f7447585897152de03242a20b.tar.gz
deluge-7bd87d1a8217024f7447585897152de03242a20b.tar.bz2
deluge-7bd87d1a8217024f7447585897152de03242a20b.zip
Fix #2335 : IPC lockfile issue preventing start of deluge-gtk
-rw-r--r--deluge/ui/gtkui/ipcinterface.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/deluge/ui/gtkui/ipcinterface.py b/deluge/ui/gtkui/ipcinterface.py
index 7ab2db059..222001c09 100644
--- a/deluge/ui/gtkui/ipcinterface.py
+++ b/deluge/ui/gtkui/ipcinterface.py
@@ -125,17 +125,19 @@ class IPCInterface(component.Component):
os.remove(f)
lockfile = socket + ".lock"
log.debug("Checking if lockfile exists: %s", lockfile)
- if os.path.lexists(lockfile):
+ if os.path.lexists(lockfile) or os.path.lexists(socket):
try:
os.kill(int(os.readlink(lockfile)), 0)
except OSError:
log.debug("Removing lockfile since it's stale.")
try:
os.remove(lockfile)
+ except OSError, ex:
+ log.error("Failed to delete IPC lockfile file: %s", ex)
+ try:
os.remove(socket)
- except Exception, e:
- log.error("Problem deleting lockfile or socket file!")
- log.exception(e)
+ except OSError, ex:
+ log.error("Failed to delete IPC socket file: %s", ex)
try:
self.factory = Factory()
self.factory.protocol = IPCProtocolServer