summaryrefslogtreecommitdiffstats
path: root/postgresql-setup.in
diff options
context:
space:
mode:
authorPavel Raiskup <praiskup@redhat.com>2015-02-10 10:49:36 +0100
committerPavel Raiskup <praiskup@redhat.com>2015-02-10 10:49:36 +0100
commit84219fefff0b9d00c94c72cf0cd903611b1cf05f (patch)
tree264b76025c5b9536123def9a3990bc7922cc3213 /postgresql-setup.in
parent82b9bab207ea3cc351581bab89abce48cff2ad12 (diff)
downloadpostgresql-setup-84219fefff0b9d00c94c72cf0cd903611b1cf05f.tar.gz
postgresql-setup-84219fefff0b9d00c94c72cf0cd903611b1cf05f.tar.xz
postgresql-setup-84219fefff0b9d00c94c72cf0cd903611b1cf05f.zip
configury: use one single variable SU_POSTGRES
We use 'su' only for 'postgres' user purposes. So have one, configure-time-proven command. Also, in the previous commit I forgot to fix sysvinit file. * configure.ac (SU_POSTGRES): New variable. * postgresql-setup.in ($SU_POSTGRES): Use detected @SU_POSTGRES@. ($SU, $SU_L_POSTGRES): Avoid usage of those. * postgresql.init.in: Likewise. * .gitignore: Remove typoed ignore.
Diffstat (limited to 'postgresql-setup.in')
-rw-r--r--postgresql-setup.in9
1 files changed, 4 insertions, 5 deletions
diff --git a/postgresql-setup.in b/postgresql-setup.in
index 959ee06..f457636 100644
--- a/postgresql-setup.in
+++ b/postgresql-setup.in
@@ -27,9 +27,8 @@ README_DIST=@README_DIST@
# Home directory of postgres user
POSTGRES_HOMEDIR=@POSTGRES_HOMEDIR@
-SU=@SU@
-
-SU_L_POSTGRES="$SU -s /bin/sh -l postgres"
+# Convenient tool-aliases
+SU_POSTGRES="@SU_POSTGRES@"
# The where PostgreSQL server listens by default
PGPORT_DEF=5432
@@ -126,7 +125,7 @@ perform_initdb()
initdbcmd="$PGENGINE/initdb --pgdata='$pgdata' --auth='ident'"
initdbcmd+=" $PGSETUP_INITDB_OPTIONS"
- $SU_L_POSTGRES -c "$initdbcmd" >> "$initdb_log" 2>&1 < /dev/null
+ $SU_POSTGRES -c "$initdbcmd" >> "$initdb_log" 2>&1 < /dev/null
# Create directory for postmaster log files
mkdir "$pgdata/pg_log"
@@ -223,7 +222,7 @@ upgrade()
# Create empty new-format database
if perform_initdb; then
# Do the upgrade
- $SU_L_POSTGRES -c "$PGENGINE/pg_upgrade \
+ $SU_POSTGRES -c "$PGENGINE/pg_upgrade \
'--old-bindir=$PREVPGENGINE' \
'--new-bindir=$PGENGINE' \
'--old-datadir=$pgdataold' \