summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Lane <tgl@redhat.com>2012-03-13 19:38:14 -0400
committerTom Lane <tgl@redhat.com>2012-03-13 19:38:14 -0400
commit628f33b2f41f07dcb9048891875e7f0bfa9ae39b (patch)
treea6c8a1996bec38bf918dd133b02b8593d5d2a2c5
parentf39fa1b34ca57b4e42da3c60e64ce503eca6eab5 (diff)
downloadpostgresql-setup-628f33b2f41f07dcb9048891875e7f0bfa9ae39b.tar.gz
postgresql-setup-628f33b2f41f07dcb9048891875e7f0bfa9ae39b.tar.xz
postgresql-setup-628f33b2f41f07dcb9048891875e7f0bfa9ae39b.zip
Fix postgresql-setup, re-add init script
-rw-r--r--postgresql-setup8
1 files changed, 6 insertions, 2 deletions
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