]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
doc: Add restart on failure to example systemd file
authorPeter Eisentraut <peter@eisentraut.org>
Tue, 3 Mar 2026 12:13:45 +0000 (13:13 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Tue, 3 Mar 2026 12:18:53 +0000 (13:18 +0100)
The documentation previously had a systemd unit file that would not
attempt to recover from process failures such as OOM's, segfaults,
etc.  This commit adds "Restart=on-failure",` which tells systemd to
attempt to restart the process after failure.  This is the recommended
configuration per the systemd documentation: "Setting this to
on-failure is the recommended choice for long-running services".  Many
PostgreSQL users will simply copy/paste what the PostgreSQL
documentation recommends and will probably do their own research and
change the service file to restart on failure, so might as well set
this as the default in the PostgreSQL documentation.

Author: Andrew Jackson <andrewjackson947@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/CAKK5BkFfMpAQnv8CLs%3Di%3DrZwurtCV_gmfRb0uZi-V%2Bd6wcryqg%40mail.gmail.com

doc/src/sgml/runtime.sgml

index b4914faff1cc97af9bf07a784b39147c1446abf6..b1937cd13abfa97a6854730e431293a8f5c3243d 100644 (file)
@@ -490,6 +490,7 @@ ExecStart=/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data
 ExecReload=/bin/kill -HUP $MAINPID
 KillMode=mixed
 KillSignal=SIGINT
+Restart=on-failure
 TimeoutSec=infinity
 
 [Install]