diff --git a/postgresql.init b/postgresql.init index f273ac5..6eb80f5 100644 --- a/postgresql.init +++ b/postgresql.init @@ -132,7 +132,7 @@ start(){ touch "$PGLOG" || exit 1 chown postgres:postgres "$PGLOG" chmod go-rwx "$PGLOG" - [ -x /usr/bin/chcon ] && /usr/bin/chcon -u system_u -r object_r -t postgresql_log_t "$PGLOG" 2>/dev/null + [ -x /sbin/restorecon ] && /sbin/restorecon "$PGLOG" fi # Check for the PGDATA structure @@ -243,8 +243,19 @@ initdb(){ fi # Clean up SELinux tagging for PGDATA [ -x /sbin/restorecon ] && /sbin/restorecon "$PGDATA" + + # Make sure the startup-time log file is OK, too + if [ ! -e "$PGLOG" -a ! -h "$PGLOG" ] + then + touch "$PGLOG" || exit 1 + chown postgres:postgres "$PGLOG" + chmod go-rwx "$PGLOG" + [ -x /sbin/restorecon ] && /sbin/restorecon "$PGLOG" + fi + # Initialize the database $SU -l postgres -c "$PGENGINE/initdb --pgdata='$PGDATA' --auth='ident'" >> "$PGLOG" 2>&1 < /dev/null + # Create directory for postmaster log mkdir "$PGDATA/pg_log" chown postgres:postgres "$PGDATA/pg_log" diff --git a/postgresql.spec b/postgresql.spec index 7e4e4e7..11780b4 100755 --- a/postgresql.spec +++ b/postgresql.spec @@ -60,7 +60,7 @@ Summary: PostgreSQL client programs and libraries Name: postgresql %define majorversion 8.4 Version: 8.4.1 -Release: 2%{?dist} +Release: 3%{?dist} # PG considers their license to be simplified BSD, but it's more nearly MIT License: MIT Group: Applications/Databases @@ -854,6 +854,10 @@ rm -rf $RPM_BUILD_ROOT %endif %changelog +* Mon Sep 21 2009 Tom Lane 8.4.1-3 +- Ensure pgstartup.log gets the right ownership/permissions during initdb +Resolves: #498959 + * Wed Sep 16 2009 Tomas Mraz - 8.4.1-2 - Use password-auth common PAM configuration instead of system-auth