Thread: Problem binding postmaster to several interfaces
Hi everyone! I have postgresql 8.0.1 installed on a Slackware Linux machine. The machine is a multi-purpose device and it has external and internal interfaces. I would like to limit "postmaster" to listen only to the internal interface and the loopback. I tried to use the new "listen_addresses" directive but with no success so far. I tried several forms - I either got a syntax error, or the "postmaster" continued to listen to all interfaces - (0.0.0.0:5432 as shown by "netstat -tupan" command). Any ideas? The current value of my "listen_addresses" setting is: listen_addresses = '192.168.0.1, 127.0.0.1' but using "netstat -tupan" I still see: tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 10042/postmaster The contents of the logfile for the last reboot is: 2005-02-14 14:14:55.105721500 LOG: received smart shutdown request 2005-02-14 14:14:55.105728500 LOG: shutting down 2005-02-14 14:14:55.255392500 LOG: database system is shut down 2005-02-14 14:15:08.852971500 LOG: could not create IPv6 socket: Address family not supported by protocol 2005-02-14 14:15:08.880414500 LOG: database system was shut down at 2005-02-14 14:15:17 EET 2005-02-14 14:15:08.880987500 LOG: checkpoint record is at 0/DBA864 2005-02-14 14:15:08.881059500 LOG: redo record is at 0/DBA864; undo record is at 0/0; shutdown TRUE 2005-02-14 14:15:08.881112500 LOG: next transaction ID: 4243; next OID: 17395 2005-02-14 14:15:08.927491500 LOG: database system is ready The server was build with: ./configure --prefix=/usr/local/postgresql --with-openssl --with-python --with-php=/usr/src/php-4.3.10 --enable-nls The system is Slackware Linux 9.1.0 with kernel "Linux xxxxxxl 2.6.10 #1 Wed Feb 2 22:59:49 EET 2005 i686 unknown unknown GNU/Linux". -- Milen A. Radev
"Milen A. Radev" <mradev@gmail.com> writes: > The current value of my "listen_addresses" setting is: > listen_addresses = '192.168.0.1, 127.0.0.1' Nothing wrong with that. > but using "netstat -tupan" I still see: > tcp 0 0 0.0.0.0:5432 0.0.0.0:* > LISTEN 10042/postmaster Are you by any chance using "-i" on the postmaster command line? That overrides whatever you put for listen_addresses in the config file. regards, tom lane
On Mon, 14 Feb 2005 12:14:33 -0500, Tom Lane <tgl@sss.pgh.pa.us> wrote: > "Milen A. Radev" <mradev@gmail.com> writes: > > The current value of my "listen_addresses" setting is: > > listen_addresses = '192.168.0.1, 127.0.0.1' > > Nothing wrong with that. > > > but using "netstat -tupan" I still see: > > > tcp 0 0 0.0.0.0:5432 0.0.0.0:* > > LISTEN 10042/postmaster > > Are you by any chance using "-i" on the postmaster command line? That > overrides whatever you put for listen_addresses in the config file. Yep, that was. I use custom script for supervising postmaster with daemontools. And I failed to notice this change in the behaviour in v8.0. Thanks a lot. > > regards, tom lane > -- Milen A. Radev