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 /postgresql.init | |
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
Diffstat (limited to 'postgresql.init')
-rw-r--r-- | postgresql.init | 13 |
1 files changed, 12 insertions, 1 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" |