updated on Tue Jan 17 00:10:10 UTC 2012
[aur-mirror.git] / postgresql-testing / postgresql.install
blobd65bb6a7f5c2e692bd48fb23976664f84cdf16ae
1 post_install() {
2   if [ ! -d '/var/lib/postgres' ]; then
3     mkdir -p '/var/lib/postgres'
4   fi
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
10 post_upgrade() {
11   post_install $1
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
16   fi
19 post_remove() {
20   getent passwd postgres >/dev/null && userdel postgres
21   getent group postgres >/dev/null && groupdel postgres