[PATCH] better systemd integration - Mailing list pgsql-hackers

From Peter Eisentraut
Subject [PATCH] better systemd integration
Date
Msg-id 564B34C5.7030209@gmx.net
Whole thread Raw
Responses Re: [PATCH] better systemd integration  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [PATCH] better systemd integration  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: [PATCH] better systemd integration  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
I have written a couple of patches to improve the integration of the
postgres daemon with systemd.

The setup that is shipped with Red Hat- and Debian-family packages at
the moment is just an imitation of the old shell scripts, relying on
polling by pg_ctl for readiness, with various custom pieces of
complexity for handling custom port numbers and such.

In the first patch, my proposal is to use sd_notify() calls from
libsystemd to notify the systemd daemon directly when startup is
completed.  This is the recommended low-overhead solution that is now
being adopted by many other server packages.  It allows us to cut out
pg_ctl completely from the startup configuration and makes the startup
configuration manageable by non-wizards.  An example is included in the
patch.

The second patch improves integration with the system journal managed by
systemd.  This is a facility that captures a daemon's standard output
and error and records it in configurable places, including syslog.  The
patch adds a new log_destination that is like stderr but marks up the
output so that systemd knows the severity.  With that in place, users
can choose to do away with the postgres log file management and let
systemd do it.

The third patch is technically unrelated but arose while I was working
on this.  It improves error reporting when the data directory is missing.

Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Speed up Clog Access by increasing CLOG buffers
Next
From: Tom Lane
Date:
Subject: Re: Bug in numeric multiplication