[Dev] Preventing user from running multiple instances

Katie Capps Parlante capps at osafoundation.org
Wed Mar 2 11:57:56 PST 2005


+1 to making it the default

Morgen Sagen wrote:
> Excellent, Andi.  Does anyone have an objection to me making 
> exclusive-access the default for Chandler?
> 
> On Mar 2, 2005, at 11:26 AM, Andi Vajda wrote:
> 
>>
>>> For various reasons we don't want the user to be able to run multiple 
>>> instances of Chandler against the same repository.  For example, if 
>>> you fire up two instances at the same time, one of them will complain 
>>> that //Schema already exists, and there are other places where things 
>>> don't quite work.  So I was wondering if anyone had an idea for a 
>>> cross-platform way to prevent multiple concurrent instances accessing 
>>> a repository.  Chandler could look for and create a lock file next to 
>>> the repository directory, and place its process ID in there, thereby 
>>> allowing it to detect whether an existing lock file is obsolete 
>>> because a previous instance died without removing it.  (Does Windows 
>>> have the notion of PID?)  This method leaves the repository itself 
>>> out of it -- purely an application level function.  Or we could get 
>>> the repository involved and have it keep track of which process has 
>>> it open, and the application layer asks the repository.  I guess I 
>>> would lean toward the former method.
>>>
>>> I'm sure there must be some python module that does this already, in 
>>> a cross-platform way...
>>
>>
>> This is an old problem that I fixed a few months ago. If you don't 
>> want multiple Chandlers to run concurrently, start the first one with 
>> -x or --exclusive.
>>
>> Andi..
>>
>>>
>>> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>>>
>>> Open Source Applications Foundation "Dev" mailing list
>>> http://lists.osafoundation.org/mailman/listinfo/dev
>>>
>> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>>
>> Open Source Applications Foundation "Dev" mailing list
>> http://lists.osafoundation.org/mailman/listinfo/dev
> 
> 
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> 
> Open Source Applications Foundation "Dev" mailing list
> http://lists.osafoundation.org/mailman/listinfo/dev



More information about the Dev mailing list