v1.7 - Duplicate Instance Detection Fails
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Kabikaboo |
Confirmed
|
Medium
|
Unassigned |
Bug Description
In 1.6 this worked.
It should be a simple fix for Linux.
Modify the search function in kabikaboo.py ~ line 2938:
# check for duplicate instance of kabikaboo
def check_for_
result = False
# WARNING: LINUX ONLY CODE
output = commands.
# check for 2 or more regular instances
if output.
result = True
# check for instance and development instance
if output.
result = True
if result:
print 'Duplicate instance of Kabikaboo already running.'
print 'Will not open last file in this case.'
print 'Starting with new document.'
return result
Windows will need different code to do this.
Changed in kabikaboo: | |
importance: | Undecided → Medium |
milestone: | none → 1.8 |
Changed in kabikaboo: | |
status: | New → Confirmed |
The 'normal' linux-ey way to do it is to write a PID file with the id of the Kabikaboo process inside it. The program then checks to see if that particular process is running and errors out if it is; if not, it replaces the old pid inside the file with the new pid. Makes cleanups a little less 'meh' with lockfiles and makes it easier to maintain if the command line suddenly changes and so the output of ps -ax isn't what is expected. (Sorry if that's incoherant, no time to wake up yet).
From what I can tell, the Windows alternative is either A. A lockfile or B. something called a 'mutex', which looks like some sort of process-unique identifier that other processes can examine. Lookie here: http:// code.activestat e.com/recipes/ 474070/
Of course, with some 'if win32:' ... 'else:' code... in between...
No time to work until this evening, but might get around to prodding around