Skip to content

Commit

Permalink
Doc: improve recommended systemd unit file.
Browse files Browse the repository at this point in the history
Add
    After=network-online.target
    Wants=network-online.target
to the suggested unit file for starting a Postgres server.
This delays startup until the network interfaces have been
configured; without that, any attempt to bind to a specific
IP address will fail.

If listen_addresses is set to "localhost" or "*", it might be
possible to get away with the less restrictive "network.target",
but I don't think we need to get into such detail here.

Per suggestion from Pablo Federico.

Discussion: https://postgr.es/m/166552157407.591805.10036014441784710940@wrigleys.postgresql.org
  • Loading branch information
tglsfdc committed Oct 12, 2022
1 parent e7b4ff3 commit 42d203c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/src/sgml/runtime.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,8 @@ fi
[Unit]
Description=PostgreSQL database server
Documentation=man:postgres(1)
After=network-online.target
Wants=network-online.target

[Service]
Type=notify
Expand Down

0 comments on commit 42d203c

Please sign in to comment.