Date: Saturday, April 23, 2011 @ 14:29:42 Author: dan Revision: 120393
Fix FS#23858 Modified: postgresql/trunk/PKGBUILD postgresql/trunk/postgresql postgresql/trunk/postgresql.install --------------------+ PKGBUILD | 4 ++-- postgresql | 28 ++++++++++++++-------------- postgresql.install | 7 ++++++- 3 files changed, 22 insertions(+), 17 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2011-04-23 17:05:32 UTC (rev 120392) +++ PKGBUILD 2011-04-23 18:29:42 UTC (rev 120393) @@ -4,7 +4,7 @@ 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 @@ } md5sums=('80390514d568a7af5ab61db1cda27e29' - '89ada7c282d9ffb82c6adc89bc2778ad' + 'eacf91f987d230f2dc2d040618ea1817' 'd63a05943cf0a2726aa2070f3033c569' '4d74f4227dc5e12bf95b3490758d86c9' '96f82c38f3f540b53f3e5144900acf17' Modified: postgresql =================================================================== --- postgresql 2011-04-23 17:05:32 UTC (rev 120392) +++ postgresql 2011-04-23 18:29:42 UTC (rev 120393) @@ -9,26 +9,26 @@ 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 @@ "$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 Modified: postgresql.install =================================================================== --- postgresql.install 2011-04-23 17:05:32 UTC (rev 120392) +++ postgresql.install 2011-04-23 18:29:42 UTC (rev 120393) @@ -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() {