From: Tom Lane <tgl@sss.pgh.pa.us>
To: pablito.federico@gmail.com
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: Server start with systemd and configured with IP address
Date: Wed, 12 Oct 2022 10:38:55 -0400
Message-ID: <811670.1665585535@sss.pgh.pa.us> (raw)
In-Reply-To: <166552157407.591805.10036014441784710940@wrigleys.postgresql.org>
References: <166552157407.591805.10036014441784710940@wrigleys.postgresql.org>
PG Doc comments form <noreply@postgresql.org> writes:
> My suggestion is add to the documentation in the segment that shows the
> systemd entry inside the [Unit] segment the line
> After=network-online.target
> I saw in several sites that most people recommends using
> After=network.target
> but this will fail if the server is configured to listen on a specific IP
> address instead of just localhost or 127.0.0.1
Yeah, I have also found with other daemons that if you use specific
IP addresses in the configuration, you need network-online.target.
Some references suggest that you *also* need to say
Wants=network-online.target [1].
It might be that network.target is sufficient if you just bind to
"*", but considering that we're not mentioning that either right
now, I don't see a need to discuss the difference.
(Down the road, maybe we should consider using IP_FREEBIND on
Linux, as suggested at [1] ... although that hobbles error
detection, so I'm not really sold that it's such a great idea.)
regards, tom lane
[1] https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: tgl@sss.pgh.pa.us, pablito.federico@gmail.com, pgsql-docs@lists.postgresql.org
Subject: Re: Server start with systemd and configured with IP address
In-Reply-To: <811670.1665585535@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox