summaryrefslogtreecommitdiffstats
path: root/postgresql-setup.in
diff options
context:
space:
mode:
Diffstat (limited to 'postgresql-setup.in')
-rw-r--r--postgresql-setup.in6
1 files changed, 4 insertions, 2 deletions
diff --git a/postgresql-setup.in b/postgresql-setup.in
index 17a14f0..959ee06 100644
--- a/postgresql-setup.in
+++ b/postgresql-setup.in
@@ -29,6 +29,8 @@ POSTGRES_HOMEDIR=@POSTGRES_HOMEDIR@
SU=@SU@
+SU_L_POSTGRES="$SU -s /bin/sh -l postgres"
+
# The where PostgreSQL server listens by default
PGPORT_DEF=5432
@@ -124,7 +126,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_L_POSTGRES -c "$initdbcmd" >> "$initdb_log" 2>&1 < /dev/null
# Create directory for postmaster log files
mkdir "$pgdata/pg_log"
@@ -221,7 +223,7 @@ upgrade()
# Create empty new-format database
if perform_initdb; then
# Do the upgrade
- $SU -l postgres -c "$PGENGINE/pg_upgrade \
+ $SU_L_POSTGRES -c "$PGENGINE/pg_upgrade \
'--old-bindir=$PREVPGENGINE' \
'--new-bindir=$PGENGINE' \
'--old-datadir=$pgdataold' \