postgresql-setup: ignore misconfigure pg_hba.conf when upgrading
Resolves: #1040364 Version: 9.3.2-2
This commit is contained in:
parent
3355515a99
commit
85e0b076bc
@ -153,6 +153,20 @@ upgrade(){
|
|||||||
rm -rf "$PGDATAOLD"
|
rm -rf "$PGDATAOLD"
|
||||||
mv "$PGDATA" "$PGDATAOLD" || exit 1
|
mv "$PGDATA" "$PGDATAOLD" || exit 1
|
||||||
|
|
||||||
|
# Create configuration file for upgrade process
|
||||||
|
HBA_CONF_BACKUP="$PGDATAOLD/pg_hba.conf.postgresql-setup.`date +%s`"
|
||||||
|
HBA_CONF_BACKUP_EXISTS=0
|
||||||
|
|
||||||
|
if [ ! -f $HBA_CONF_BACKUP ]; then
|
||||||
|
mv "$PGDATAOLD/pg_hba.conf" "$HBA_CONF_BACKUP"
|
||||||
|
HBA_CONF_BACKUP_EXISTS=1
|
||||||
|
|
||||||
|
# For fluent upgrade 'postgres' user should be able to connect
|
||||||
|
# to any database without password. Temporarily, no other type
|
||||||
|
# of connection is needed.
|
||||||
|
/usr/bin/echo -e "local all postgres ident" > "$PGDATAOLD/pg_hba.conf"
|
||||||
|
fi
|
||||||
|
|
||||||
echo -n $"Upgrading database: "
|
echo -n $"Upgrading database: "
|
||||||
|
|
||||||
# Create empty new-format database
|
# Create empty new-format database
|
||||||
@ -177,9 +191,18 @@ upgrade(){
|
|||||||
script_result=1
|
script_result=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ x$HBA_CONF_BACKUP_EXISTS = x1 ]; then
|
||||||
|
mv -f "$HBA_CONF_BACKUP" "$PGDATAOLD/pg_hba.conf"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ $script_result -eq 0 ]
|
if [ $script_result -eq 0 ]
|
||||||
then
|
then
|
||||||
echo $"OK"
|
echo $"OK"
|
||||||
|
echo
|
||||||
|
echo $"The configuration files was replaced by default configuration."
|
||||||
|
echo $"The previous configuration and data are stored in folder"
|
||||||
|
echo $PGDATAOLD.
|
||||||
else
|
else
|
||||||
# Clean up after failure
|
# Clean up after failure
|
||||||
rm -rf "$PGDATA"
|
rm -rf "$PGDATA"
|
||||||
|
@ -64,7 +64,7 @@ Summary: PostgreSQL client programs
|
|||||||
Name: postgresql
|
Name: postgresql
|
||||||
%global majorversion 9.3
|
%global majorversion 9.3
|
||||||
Version: 9.3.2
|
Version: 9.3.2
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
|
|
||||||
# The PostgreSQL license is very similar to other MIT licenses, but the OSI
|
# The PostgreSQL license is very similar to other MIT licenses, but the OSI
|
||||||
# recognizes it as an independent license, so we do as well.
|
# recognizes it as an independent license, so we do as well.
|
||||||
@ -1122,6 +1122,9 @@ fi
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Dec 12 2013 Jozef Mlich <jmlich@redhat.com> - 9.3.2-2
|
||||||
|
- don't fail if user has badly configure 'postgres' user access (#1040364)
|
||||||
|
|
||||||
* Thu Dec 05 2013 Jozef Mlich <jmlich@redhat.com> - 9.3.2-1
|
* Thu Dec 05 2013 Jozef Mlich <jmlich@redhat.com> - 9.3.2-1
|
||||||
- update to 9.3.2 minor version per release notes:
|
- update to 9.3.2 minor version per release notes:
|
||||||
http://www.postgresql.org/docs/9.3/static/release-9-3-2.html
|
http://www.postgresql.org/docs/9.3/static/release-9-3-2.html
|
||||||
|
Loading…
Reference in New Issue
Block a user