class IPIDFile(Interface): (source)
Known implementations: twisted.application.runner._pidfile.NonePIDFile
, twisted.application.runner._pidfile.PIDFile
Method | __enter__ |
Enter a context using this PIDFile. |
Method | __exit__ |
Exit a context using this PIDFile. |
Method | isRunning |
Determine whether there is a running process corresponding to the PID in this PID file. |
Method | read |
Read the process ID stored in this PID file. |
Method | remove |
Remove this PID file. |
Method | writeRunningPID |
Store the PID of the current process in this PID file. |
Enter a context using this PIDFile.
Writes the PID file with the PID of the running process.
Returns | |
IPIDFile | Undocumented |
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:Optional[ | Undocumented |
excValue:Optional[ | Undocumented |
traceback:Optional[ | Undocumented |
Returns | |
Optional[ | Undocumented |
Returns | |
bool | True if this PID file contains a PID and a process with that PID is currently running; false otherwise. |
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. |
Returns | |
int | The contained process ID. |
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. |
Raises | |
EnvironmentError | If this PID file cannot be written. |