Package gavo :: Package user :: Module serve :: Class _PIDManager
[hide private]
[frames] | no frames]

Class _PIDManager

source code

object --+
         |
        _PIDManager

A manager for the PID of the server.

There's a single instance of this below.

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
getPID(self)
returns the PID of the currently running server, or None.
source code
 
setPID(self)
writes the current process' PID to the PID file.
source code
 
clearPID(self)
removes the PID file.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

setPID(self)

source code 

writes the current process' PID to the PID file.

Any existing content will be clobbered; thus, you could have races here (and since both daemons would bind to the same socket, only one would survive, possibly the wrong one). Let's just stipulate people won't start two competing daemons.