patroni.postgresql.postmaster module

class patroni.postgresql.postmaster.PostmasterProcess(pid: int)View on GitHub

Bases: Process

__init__(pid: int) NoneView on GitHub
classmethod _from_pidfile(data_dir: str) PostmasterProcess | NoneView on GitHub
_is_postmaster_process() boolView on GitHub
static _read_postmaster_pidfile(data_dir: str) Dict[str, str]View on GitHub

Reads and parses postmaster.pid from the data directory

:returns dictionary of values if successful, empty dictionary otherwise

classmethod from_pid(pid: int) PostmasterProcess | NoneView on GitHub
static from_pidfile(data_dir: str) PostmasterProcess | NoneView on GitHub
pg_ctl_kill(mode: str, pg_ctl: str) bool | NoneView on GitHub
signal_kill() boolView on GitHub

to suspend and kill postmaster and all children

:returns True if postmaster and children are killed, False if error

signal_stop(mode: str, pg_ctl: str = 'pg_ctl') bool | NoneView on GitHub

Signal postmaster process to stop

:returns None if signaled, True if process is already gone, False if error

static start(pgcommand: str, data_dir: str, conf: str, options: List[str]) PostmasterProcess | NoneView on GitHub
wait_for_user_backends_to_close(stop_timeout: float | None) NoneView on GitHub
patroni.postgresql.postmaster.pg_ctl_start(conn: Connection, cmdline: List[str], env: Dict[str, str]) NoneView on GitHub