From: Thierry Parmentelat Date: Mon, 16 May 2011 09:13:24 +0000 (+0200) Subject: tweak the way postgresql.conf defines listen_addresses X-Git-Tag: plcapi-5.0-33~3 X-Git-Url: http://git.onelab.eu/?p=plcapi.git;a=commitdiff_plain;h=1dfddce18141ddfa0cb435800dc828836881394f tweak the way postgresql.conf defines listen_addresses now mention PLC_DB_HOST and localhost in some setups, when run inside a vserver, localhost was found to not be bound --- diff --git a/plc.d/postgresql b/plc.d/postgresql index 536e7c0..7e340f0 100755 --- a/plc.d/postgresql +++ b/plc.d/postgresql @@ -80,18 +80,12 @@ case "$1" in fi # Enable DB server. PostgreSQL >=8.0 defines listen_addresses, - # PostgreSQL 7.x uses tcpip_socket. - if grep -q listen_addresses $postgresql_conf ; then - sed -i -e '/^listen_addresses/d' $postgresql_conf - echo "listen_addresses = '*'" >> $postgresql_conf - # tweak timezone to be 'UTC' - sed -i -e '/^timezone=/d' $postgresql_conf - echo "timezone='UTC'" >> $postgresql_conf - else - dialog "PostgreSQL <= 7.x - not supported" - /bin/false - check - fi + # when run within a vserver, this may require localhost to be specified explicitly + sed -i -e '/^listen_addresses/d' $postgresql_conf + echo "listen_addresses = '${PLC_DB_HOST},localhost'" >> $postgresql_conf + # tweak timezone to be 'UTC' + sed -i -e '/^timezone=/d' $postgresql_conf + echo "timezone='UTC'" >> $postgresql_conf # Disable access to all DBs from all hosts sed -i -e '/^\(host\|local\)/d' $pghba_conf