diff options
Diffstat (limited to 'postgresql.install')
-rw-r--r-- | postgresql.install | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/postgresql.install b/postgresql.install index 0d23d474a0c2..c46a58d5f83d 100644 --- a/postgresql.install +++ b/postgresql.install @@ -1,25 +1,7 @@ -post_install() { - if [ ! -d '/var/lib/postgres' ]; then - mkdir -p '/var/lib/postgres' - fi - if ! getent group postgres >/dev/null; then - groupadd -g 88 postgres - fi - if ! getent passwd postgres >/dev/null; then - useradd -c 'PostgreSQL user' -u 88 -g postgres -d '/var/lib/postgres' -s /bin/bash postgres - passwd -l postgres >/dev/null - fi - if [ ! -d '/var/lib/postgres/data' ]; then - mkdir -p '/var/lib/postgres/data' - chown postgres:postgres '/var/lib/postgres/data' - fi -} - post_upgrade() { - post_install $1 - # FS#23858, fix postgres user shell issue - postgres_shell=$(getent passwd postgres | cut -d: -f7) - if [ "$postgres_shell" = "/sbin/nologin" ]; then - chsh -s /bin/bash postgres + # Prints the warning message if the database version on disk + # does not match the PostgreSQL major version. + if [ -d /var/lib/postgres/data ]; then + /usr/bin/postgresql-check-db-dir /var/lib/postgres/data || true fi } |