2 if [ ! -d '/var/lib/postgres' ]; then
3 mkdir -p '/var/lib/postgres'
5 getent group postgres >/dev/null || groupadd -g 88 postgres
6 getent passwd postgres >/dev/null || useradd -c 'PostgreSQL user' -u 88 -g postgres -d '/var/lib/postgres' -s /bin/bash postgres
7 passwd -l postgres >/dev/null
12 # FS#23858, fix postgres user shell issue
13 postgres_shell=$(getent passwd postgres | cut -d: -f7)
14 if [ "$postgres_shell" = "/sbin/nologin" ]; then
15 chsh -s /bin/bash postgres
20 getent passwd postgres >/dev/null && userdel postgres
21 getent group postgres >/dev/null && groupdel postgres