Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oict1-0003sx-6S for pgsql-docs@arkaria.postgresql.org; Wed, 12 Oct 2022 14:39:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oicsz-0004KZ-6G for pgsql-docs@arkaria.postgresql.org; Wed, 12 Oct 2022 14:39:05 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oicsy-0004KP-V6 for pgsql-docs@lists.postgresql.org; Wed, 12 Oct 2022 14:39:04 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oicsr-0003an-Ro for pgsql-docs@lists.postgresql.org; Wed, 12 Oct 2022 14:39:03 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 29CEctHG811671; Wed, 12 Oct 2022 10:38:55 -0400 From: Tom Lane To: pablito.federico@gmail.com cc: pgsql-docs@lists.postgresql.org Subject: Re: Server start with systemd and configured with IP address In-reply-to: <166552157407.591805.10036014441784710940@wrigleys.postgresql.org> References: <166552157407.591805.10036014441784710940@wrigleys.postgresql.org> Comments: In-reply-to PG Doc comments form message dated "Tue, 11 Oct 2022 20:52:54 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <811669.1665585535.1@sss.pgh.pa.us> Date: Wed, 12 Oct 2022 10:38:55 -0400 Message-ID: <811670.1665585535@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Doc comments form 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/