X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plc.d%2Fpostgresql;h=93cac8c4bd3fda251d0401459079d05b9934ad42;hb=787b5830074330e18c93aaa4aeca59d4ad8bed15;hp=536e7c0d319e79b682bca3d50ad2e9f4b23f336f;hpb=35090de3c94d062d296ff328686d495e667db66f;p=plcapi.git diff --git a/plc.d/postgresql b/plc.d/postgresql index 536e7c0..93cac8c 100755 --- a/plc.d/postgresql +++ b/plc.d/postgresql @@ -79,19 +79,14 @@ case "$1" in check 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 + # Enable DB server. drop Postgresql<=7.x + # PostgreSQL >=8.0 defines listen_addresses + # listen on a specific IP + localhost, more robust when run within a vserver + 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