From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ludwig Isaac Lim <ludz_lim@yahoo.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: Network Card Not Listening at Startup
Date: Wed, 09 Feb 2022 12:49:03 -0500
Message-ID: <1433798.1644428943@sss.pgh.pa.us> (raw)
In-Reply-To: <1854983886.1394387.1644424343951@mail.yahoo.com>
References: <1854983886.1394387.1644424343951.ref@mail.yahoo.com>
<1854983886.1394387.1644424343951@mail.yahoo.com>
Ludwig Isaac Lim <ludz_lim@yahoo.com> writes:
> How do make sure that NIC will be listening every time I started/restarted the server?
You need to tell systemd not to start the postgresql service
until the network is up.
In basic cases, you can edit the postgresql.service file,
or maybe better create an add-on config file something like this:
$ cat /etc/systemd/system/postgresql.service.d/delay_start.conf
[Unit]
After=network-online.target
Wants=network-online.target
(The add-on file name doesn't matter, the directory name does.)
I'm not certain that this will wait for custom NICs if you are
doing something nonstandard to configure those, but for me
it works for alternate IPs configured in
/etc/sysconfig/network-scripts/ifcfg-whatever.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, ludz_lim@yahoo.com
Subject: Re: Network Card Not Listening at Startup
In-Reply-To: <1433798.1644428943@sss.pgh.pa.us>
References: <1854983886.1394387.1644424343951.ref@mail.yahoo.com> <1854983886.1394387.1644424343951@mail.yahoo.com> <1433798.1644428943@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