mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 07:20:20 +00:00
@@ -102,6 +102,8 @@ raft
|
|||||||
`pysyncobj` module in order to use python Raft implementation as DCS
|
`pysyncobj` module in order to use python Raft implementation as DCS
|
||||||
aws
|
aws
|
||||||
`boto3` in order to use AWS callbacks
|
`boto3` in order to use AWS callbacks
|
||||||
|
systemd
|
||||||
|
`systemd-python` in order to use sd_notify integration
|
||||||
all
|
all
|
||||||
all of the above (except psycopg family)
|
all of the above (except psycopg family)
|
||||||
psycopg3
|
psycopg3
|
||||||
|
|||||||
@@ -62,6 +62,8 @@ aws
|
|||||||
`boto3` in order to use AWS callbacks
|
`boto3` in order to use AWS callbacks
|
||||||
jsonlogger
|
jsonlogger
|
||||||
`python-json-logger` module in order to enable :ref:`logging <log_settings>` in json format
|
`python-json-logger` module in order to enable :ref:`logging <log_settings>` in json format
|
||||||
|
systemd
|
||||||
|
`systemd-python` in order to use sd_notify integration
|
||||||
all
|
all
|
||||||
all of the above (except psycopg family)
|
all of the above (except psycopg family)
|
||||||
psycopg
|
psycopg
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ Description=Runners to orchestrate a high-availability PostgreSQL
|
|||||||
After=syslog.target network.target
|
After=syslog.target network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=notify
|
||||||
|
|
||||||
User=postgres
|
User=postgres
|
||||||
Group=postgres
|
Group=postgres
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ from __future__ import print_function
|
|||||||
|
|
||||||
import abc
|
import abc
|
||||||
import argparse
|
import argparse
|
||||||
|
import logging
|
||||||
import os
|
import os
|
||||||
import signal
|
import signal
|
||||||
import sys
|
import sys
|
||||||
@@ -17,6 +18,8 @@ from typing import Any, Optional, Type, TYPE_CHECKING
|
|||||||
if TYPE_CHECKING: # pragma: no cover
|
if TYPE_CHECKING: # pragma: no cover
|
||||||
from .config import Config
|
from .config import Config
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def get_base_arg_parser() -> argparse.ArgumentParser:
|
def get_base_arg_parser() -> argparse.ArgumentParser:
|
||||||
"""Create a basic argument parser with the arguments used for both patroni and raft controller daemon.
|
"""Create a basic argument parser with the arguments used for both patroni and raft controller daemon.
|
||||||
@@ -134,6 +137,11 @@ class AbstractPatroniDaemon(abc.ABC):
|
|||||||
Start the logger thread and keep running execution cycles until a SIGTERM is eventually received. Also reload
|
Start the logger thread and keep running execution cycles until a SIGTERM is eventually received. Also reload
|
||||||
configuration upon receiving SIGHUP.
|
configuration upon receiving SIGHUP.
|
||||||
"""
|
"""
|
||||||
|
try: # pragma: no cover
|
||||||
|
from systemd import daemon # pyright: ignore
|
||||||
|
daemon.notify("READY=1") # pyright: ignore
|
||||||
|
except ImportError: # pragma: no cover
|
||||||
|
logger.info("Systemd integration is not supported")
|
||||||
self.logger.start()
|
self.logger.start()
|
||||||
while not self.received_sigterm:
|
while not self.received_sigterm:
|
||||||
if self._received_sighup:
|
if self._received_sighup:
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ KEYWORDS = 'etcd governor patroni postgresql postgres ha haproxy confd' +\
|
|||||||
|
|
||||||
EXTRAS_REQUIRE = {'aws': ['boto3'], 'etcd': ['python-etcd'], 'etcd3': ['python-etcd'],
|
EXTRAS_REQUIRE = {'aws': ['boto3'], 'etcd': ['python-etcd'], 'etcd3': ['python-etcd'],
|
||||||
'consul': ['py-consul'], 'exhibitor': ['kazoo'], 'zookeeper': ['kazoo'],
|
'consul': ['py-consul'], 'exhibitor': ['kazoo'], 'zookeeper': ['kazoo'],
|
||||||
|
'systemd': ['systemd-python'],
|
||||||
'kubernetes': [], 'raft': ['pysyncobj', 'cryptography'], 'jsonlogger': ['python-json-logger']}
|
'kubernetes': [], 'raft': ['pysyncobj', 'cryptography'], 'jsonlogger': ['python-json-logger']}
|
||||||
|
|
||||||
# Add here all kinds of additional classifiers as defined under
|
# Add here all kinds of additional classifiers as defined under
|
||||||
|
|||||||
Reference in New Issue
Block a user