class twisted.application.runner._pidfile.PIDFile: (source)
Implements interfaces: twisted.application.runner._pidfile.IPIDFile
Concrete implementation of IPIDFile
.
This implementation is presently not supported on non-POSIX platforms. Specifically, calling PIDFile.isRunning
will raise NotImplementedError
.
Method | __init__ | |
Instance Variable | filePath | Undocumented |
Method | read | Read the process ID stored in this PID file. |
Method | writeRunningPID | Store the PID of the current process in this PID file. |
Method | remove | Remove this PID file. |
Method | isRunning | Determine whether there is a running process corresponding to the PID in this PID file. |
Method | __enter__ | Enter a context using this PIDFile. |
Method | __exit__ | Exit a context using this PIDFile. |
Class Variable | _log | Undocumented |
Static Method | _format | Format a PID file's content. |
Method | _write | Store a PID in this PID file. |
Static Method | _pidIsRunningPOSIX | POSIX implementation for running process check. |
Parameters | filePath | The path to the PID file on disk. (type: FilePath ) |
Read the process ID stored in this PID file.
Returns | The contained process ID. (type: int ) | |
Raises | NoPIDFound | If this PID file does not exist. |
EnvironmentError | If this PID file cannot be read. | |
ValueError | If this PID file's content is invalid. |
Store a PID in this PID file.
Parameters | pid | A PID to store. (type: int ) |
Raises | EnvironmentError | If this PID file cannot be written. |
Store the PID of the current process in this PID file.
Raises | EnvironmentError | If this PID file cannot be written. |
Remove this PID file.
Raises | EnvironmentError | If this PID file cannot be removed. |
Determine whether there is a running process corresponding to the PID in this PID file.
Returns | True if this PID file contains a PID and a process with that PID is currently running; false otherwise. (type: bool ) | |
Raises | EnvironmentError | If this PID file cannot be read. |
InvalidPIDFileError | If this PID file's content is invalid. | |
StalePIDFileError | If this PID file's content refers to a PID for which there is no corresponding running process. |
POSIX implementation for running process check.
Determine whether there is a running process corresponding to the given PID.
Parameters | pid | The PID to check. (type: int ) |
Returns | True if the given PID is currently running; false otherwise. (type: bool ) | |
Raises | EnvironmentError | If this PID file cannot be read. |
InvalidPIDFileError | If this PID file's content is invalid. | |
StalePIDFileError | If this PID file's content refers to a PID for which there is no corresponding running process. |
Enter a context using this PIDFile.
Writes the PID file with the PID of the running process.
Returns | Undocumented (type: PIDFile ) | |
Raises | AlreadyRunningError | A process corresponding to the PID in this PID file is already running. |
Exit a context using this PIDFile.
Removes the PID file.
Parameters | excType | Undocumented (type: Optional[Type[BaseException]] ) |
excValue | Undocumented (type: Optional[BaseException] ) | |
traceback | Undocumented (type: Optional[TracebackType] ) |