Exscript.util.pidutil module

Handling PID (process id) files.

Exscript.util.pidutil.isalive(path)[source]

Returns True if the file with the given name contains a process id that is still alive. Returns False otherwise.

Parameters:path (str) – The name of the pidfile.
Return type:bool
Returns:Whether the process is alive.
Exscript.util.pidutil.kill(path)[source]

Kills the process, if it still exists.

Parameters:path (str) – The name of the pidfile.
Exscript.util.pidutil.read(path)[source]

Returns the process id from the given file if it exists, or None otherwise. Raises an exception for all other types of OSError while trying to access the file.

Parameters:path (str) – The name of the pidfile.
Return type:int or None
Returns:The PID, or none if the file was not found.
Exscript.util.pidutil.remove(path)[source]

Deletes the pidfile if it exists.

Parameters:path (str) – The name of the pidfile.
Exscript.util.pidutil.write(path)[source]

Writes the current process id to the given pidfile.

Parameters:path (str) – The name of the pidfile.