From 628f33b2f41f07dcb9048891875e7f0bfa9ae39b Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 13 Mar 2012 19:38:14 -0400 Subject: Fix postgresql-setup, re-add init script --- postgresql-setup | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'postgresql-setup') diff --git a/postgresql-setup b/postgresql-setup index 8b2a9ce..29da10a 100644 --- a/postgresql-setup +++ b/postgresql-setup @@ -26,6 +26,10 @@ fi if [ -f "/etc/systemd/system/${SERVICE_NAME}.service" ] then SERVICE_FILE="/etc/systemd/system/${SERVICE_NAME}.service" +elif [ -f "/usr/lib/systemd/system/${SERVICE_NAME}.service" ] +then + SERVICE_FILE="/usr/lib/systemd/system/${SERVICE_NAME}.service" +# this case should go away eventually, but not till F16 is dead: elif [ -f "/lib/systemd/system/${SERVICE_NAME}.service" ] then SERVICE_FILE="/lib/systemd/system/${SERVICE_NAME}.service" @@ -35,8 +39,8 @@ else fi # Get port number and data directory from the service file -PGPORT=`sed -n 's/Environment=PGPORT=//p' "${SERVICE_FILE}"` -PGDATA=`sed -n 's/Environment=PGDATA=//p' "${SERVICE_FILE}"` +PGPORT=`sed -n 's/^[ \t]*Environment=PGPORT=//p' "${SERVICE_FILE}"` +PGDATA=`sed -n 's/^[ \t]*Environment=PGDATA=//p' "${SERVICE_FILE}"` # Log file for initdb PGLOG=/var/lib/pgsql/initdb.log -- cgit