]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Doc: improve recommended systemd unit file.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 12 Oct 2022 14:51:11 +0000 (10:51 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 12 Oct 2022 14:51:50 +0000 (10:51 -0400)
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

doc/src/sgml/runtime.sgml

index 11e85e8c1ffe19c8a3b8d7ab99f343b53dd1c6f5..7e1f4fd85f64430a3e3bd4cda4599be0d494fd17 100644 (file)
@@ -387,6 +387,8 @@ fi
 [Unit]
 Description=PostgreSQL database server
 Documentation=man:postgres(1)
+After=network-online.target
+Wants=network-online.target
 
 [Service]
 Type=notify