summaryrefslogtreecommitdiff
path: root/extra/postgresql
diff options
context:
space:
mode:
authorroot <root@rshg047.dnsready.net>2011-04-27 22:24:53 +0000
committerroot <root@rshg047.dnsready.net>2011-04-27 22:24:53 +0000
commit18d6577d511b9a1ac36eaae50060133a401e42a3 (patch)
treef681f9444a7a0a95916de40af82d3b805d5fb8d3 /extra/postgresql
parent69e1fada8bdc9588d0a3d8bc3403fa809d809a84 (diff)
Wed Apr 27 22:24:53 UTC 2011
Diffstat (limited to 'extra/postgresql')
-rw-r--r--extra/postgresql/PKGBUILD6
-rwxr-xr-xextra/postgresql/postgresql28
-rw-r--r--extra/postgresql/postgresql.install7
3 files changed, 23 insertions, 18 deletions
diff --git a/extra/postgresql/PKGBUILD b/extra/postgresql/PKGBUILD
index f6c50c036..5c5ffd2db 100644
--- a/extra/postgresql/PKGBUILD
+++ b/extra/postgresql/PKGBUILD
@@ -1,10 +1,10 @@
-# $Id: PKGBUILD 120038 2011-04-18 17:35:03Z dan $
+# $Id: PKGBUILD 120393 2011-04-23 18:29:42Z dan $
# Maintainer: Dan McGee <dan@archlinux.org>
pkgbase=postgresql
pkgname=('postgresql-libs' 'postgresql-docs' 'postgresql')
pkgver=9.0.4
-pkgrel=1
+pkgrel=2
arch=('i686' 'x86_64')
url="http://www.postgresql.org"
license=('custom:PostgreSQL')
@@ -130,7 +130,7 @@ package_postgresql() {
}
md5sums=('80390514d568a7af5ab61db1cda27e29'
- '89ada7c282d9ffb82c6adc89bc2778ad'
+ 'eacf91f987d230f2dc2d040618ea1817'
'd63a05943cf0a2726aa2070f3033c569'
'4d74f4227dc5e12bf95b3490758d86c9'
'96f82c38f3f540b53f3e5144900acf17'
diff --git a/extra/postgresql/postgresql b/extra/postgresql/postgresql
index 3a8bf44f8..0fbe94036 100755
--- a/extra/postgresql/postgresql
+++ b/extra/postgresql/postgresql
@@ -9,26 +9,26 @@ PGROOT=${PGROOT:-/var/lib/postgres}
PG_CTL="/usr/bin/pg_ctl -D $PGROOT/data -l /var/log/postgresql.log -s -w"
postgres_init() {
- # initialization
- if [ ! -d $PGROOT/data ]; then
- mkdir -p $PGROOT/data && chown -R postgres:postgres $PGROOT
- su - postgres -c "/usr/bin/initdb $INITOPTS -D $PGROOT/data"
- fi
- if [ ! -e /var/log/postgresql.log ]; then
- touch /var/log/postgresql.log
- chown postgres /var/log/postgresql.log
- fi
+ # initialization
+ if [ ! -d $PGROOT/data ]; then
+ mkdir -p $PGROOT/data && chown -R postgres:postgres $PGROOT
+ su - postgres -c "/usr/bin/initdb $INITOPTS -D $PGROOT/data"
+ fi
+ if [ ! -e /var/log/postgresql.log ]; then
+ touch /var/log/postgresql.log
+ chown postgres /var/log/postgresql.log
+ fi
}
case "$1" in
start)
- postgres_init
+ postgres_init
stat_busy "Starting PostgreSQL"
su - postgres -c \
"$PG_CTL start"
if [ $? -gt 0 ]; then
stat_fail
- exit 1
+ exit 1
else
add_daemon postgresql
stat_done
@@ -51,19 +51,19 @@ case "$1" in
"$PG_CTL reload"
if [ $? -gt 0 ]; then
stat_fail
- exit 1
+ exit 1
else
stat_done
fi
;;
restart)
- postgres_init
+ postgres_init
stat_busy "Restarting PostgreSQL"
su - postgres -c \
"$PG_CTL restart -m fast"
if [ $? -gt 0 ]; then
stat_fail
- exit 1
+ exit 1
else
add_daemon postgresql
stat_done
diff --git a/extra/postgresql/postgresql.install b/extra/postgresql/postgresql.install
index 4a6f9b848..c3fa4fc3e 100644
--- a/extra/postgresql/postgresql.install
+++ b/extra/postgresql/postgresql.install
@@ -1,11 +1,16 @@
post_install() {
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 /sbin/nologin 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() {