diff options
author | Pavel Raiskup <praiskup@redhat.com> | 2015-02-10 08:18:11 +0100 |
---|---|---|
committer | Pavel Raiskup <praiskup@redhat.com> | 2015-02-10 10:02:56 +0100 |
commit | 82b9bab207ea3cc351581bab89abce48cff2ad12 (patch) | |
tree | d2286023e1cdf502dda0854d2f479d63d17115f0 /postgresql-setup.in | |
parent | 5ffd9429a89422b6e15f8d05c8ce3ad504e958de (diff) | |
download | postgresql-setup-82b9bab207ea3cc351581bab89abce48cff2ad12.tar.gz postgresql-setup-82b9bab207ea3cc351581bab89abce48cff2ad12.tar.xz postgresql-setup-82b9bab207ea3cc351581bab89abce48cff2ad12.zip |
postgresql-setup: mention login shell explicitly
The setup script was reported to not work if user 'postgres' has
/sbin/nologin in /etc/passwd (explicitly set by administrator).
This configuration does not seem to be terribly useful but there
is no need to fail at all.
Resolves: rhbz#1122143
* postgresql-setup.in ($SU_L_POSTGRES): New wrapping variable,
using '-s /bin/sh' to bypass /sbin/nologin. This option should be
supported both by 'su' and 'runuser'.
* NEWS: Document.
Diffstat (limited to 'postgresql-setup.in')
-rw-r--r-- | postgresql-setup.in | 6 |
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' \ |