diff options
author | Tom Lane <tgl@fedoraproject.org> | 2009-09-22 00:45:57 +0000 |
---|---|---|
committer | Tom Lane <tgl@fedoraproject.org> | 2009-09-22 00:45:57 +0000 |
commit | 8387bb8f87d49463413e237acef387a0e5ad0a52 (patch) | |
tree | ce33d8f2745a89589e41f97f8261c62839d0da7e | |
parent | 17942eb8cd12e9c9bb07ab42d7b42986b1a8e845 (diff) | |
download | postgresql-setup-8387bb8f87d49463413e237acef387a0e5ad0a52.tar.gz postgresql-setup-8387bb8f87d49463413e237acef387a0e5ad0a52.tar.xz postgresql-setup-8387bb8f87d49463413e237acef387a0e5ad0a52.zip |
Ensure pgstartup.log gets the right ownership/permissions during initdbpostgresql-8_4_1-3_fc12F-12-startF-12-split
-rw-r--r-- | postgresql.init | 13 | ||||
-rwxr-xr-x | postgresql.spec | 6 |
2 files changed, 17 insertions, 2 deletions
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 <tgl@redhat.com> 8.4.1-3 +- Ensure pgstartup.log gets the right ownership/permissions during initdb +Resolves: #498959 + * Wed Sep 16 2009 Tomas Mraz <tmraz@redhat.com> - 8.4.1-2 - Use password-auth common PAM configuration instead of system-auth |