summaryrefslogtreecommitdiffstats
path: root/abs/extra/postgresql/postgresql.install
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2012-08-07 20:45:17 (GMT)
committerJames Meyer <james.meyer@operamail.com>2012-08-07 20:45:17 (GMT)
commit3e6d2f6713bc1e8c87012cba1526f8558e5bf095 (patch)
tree4c024ab576c493003368ab99f466910e0161f298 /abs/extra/postgresql/postgresql.install
parent267d2ce652e7b6e2eccb1c26712a895708ebf964 (diff)
downloadlinhes_pkgbuild-3e6d2f6713bc1e8c87012cba1526f8558e5bf095.zip
linhes_pkgbuild-3e6d2f6713bc1e8c87012cba1526f8558e5bf095.tar.gz
linhes_pkgbuild-3e6d2f6713bc1e8c87012cba1526f8558e5bf095.tar.bz2
postgresql 9..14
Diffstat (limited to 'abs/extra/postgresql/postgresql.install')
-rw-r--r--abs/extra/postgresql/postgresql.install26
1 files changed, 26 insertions, 0 deletions
diff --git a/abs/extra/postgresql/postgresql.install b/abs/extra/postgresql/postgresql.install
new file mode 100644
index 0000000..c524322
--- /dev/null
+++ b/abs/extra/postgresql/postgresql.install
@@ -0,0 +1,26 @@
+post_install() {
+ if [ ! -d '/var/lib/postgres' ]; then
+ mkdir -p '/var/lib/postgres'
+ fi
+ getent group postgres >/dev/null || groupadd -g 88 postgres
+ getent passwd postgres >/dev/null || useradd -c 'PostgreSQL user' -u 88 -g postgres -d '/var/lib/postgres' -s /bin/bash postgres
+ passwd -l postgres >/dev/null
+}
+
+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
+ fi
+}
+
+post_remove() {
+ if getent passwd postgres >/dev/null; then
+ userdel postgres
+ fi
+ if getent group postgres >/dev/null; then
+ groupdel postgres
+ fi
+}