mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-01-27 10:20:10 +00:00
@@ -102,6 +102,8 @@ raft
|
||||
`pysyncobj` module in order to use python Raft implementation as DCS
|
||||
aws
|
||||
`boto3` in order to use AWS callbacks
|
||||
systemd
|
||||
`systemd-python` in order to use sd_notify integration
|
||||
all
|
||||
all of the above (except psycopg family)
|
||||
psycopg3
|
||||
|
||||
@@ -62,6 +62,8 @@ aws
|
||||
`boto3` in order to use AWS callbacks
|
||||
jsonlogger
|
||||
`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 of the above (except psycopg family)
|
||||
psycopg
|
||||
|
||||
@@ -6,7 +6,7 @@ Description=Runners to orchestrate a high-availability PostgreSQL
|
||||
After=syslog.target network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Type=notify
|
||||
|
||||
User=postgres
|
||||
Group=postgres
|
||||
|
||||
@@ -7,6 +7,7 @@ from __future__ import print_function
|
||||
|
||||
import abc
|
||||
import argparse
|
||||
import logging
|
||||
import os
|
||||
import signal
|
||||
import sys
|
||||
@@ -17,6 +18,8 @@ from typing import Any, Optional, Type, TYPE_CHECKING
|
||||
if TYPE_CHECKING: # pragma: no cover
|
||||
from .config import Config
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def get_base_arg_parser() -> argparse.ArgumentParser:
|
||||
"""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
|
||||
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()
|
||||
while not self.received_sigterm:
|
||||
if self._received_sighup:
|
||||
|
||||
1
setup.py
1
setup.py
@@ -26,6 +26,7 @@ KEYWORDS = 'etcd governor patroni postgresql postgres ha haproxy confd' +\
|
||||
|
||||
EXTRAS_REQUIRE = {'aws': ['boto3'], 'etcd': ['python-etcd'], 'etcd3': ['python-etcd'],
|
||||
'consul': ['py-consul'], 'exhibitor': ['kazoo'], 'zookeeper': ['kazoo'],
|
||||
'systemd': ['systemd-python'],
|
||||
'kubernetes': [], 'raft': ['pysyncobj', 'cryptography'], 'jsonlogger': ['python-json-logger']}
|
||||
|
||||
# Add here all kinds of additional classifiers as defined under
|
||||
|
||||
Reference in New Issue
Block a user