Re: Network Card Not Listening at Startup - Mailing list pgsql-general

From Tom Lane
Subject Re: Network Card Not Listening at Startup
Date
Msg-id 1433798.1644428943@sss.pgh.pa.us
Whole thread Raw
In response to Network Card Not Listening at Startup  (Ludwig Isaac Lim <ludz_lim@yahoo.com>)
Responses Re: Network Card Not Listening at Startup  (Ludwig Isaac Lim <ludz_lim@yahoo.com>)
List pgsql-general
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



pgsql-general by date:

Previous
From: Ludwig Isaac Lim
Date:
Subject: Network Card Not Listening at Startup
Next
From: Andrew Hardy
Date:
Subject: DELETING then INSERTING record with same PK in the same TRANSACTION