opscode/cookbooks — pull request #369 by tjdett (2012-03-07 04:33:12+00:00)
Title: Adding SELinux permission handling to postgresql server recipe.

The postgresql recipe works fine under SELinux, except that the replaced files don't have the right permissions restored on them after writing. As a result, the server fails with the following (or similar) in `pgstartup.log`:

FATAL: could not open configuration file "/var/lib/pgsql/data/postgresql.conf": Permission denied

This patch attempts to fix that issue by running the following command after those files are changed:

restorecon -R #{node[:postgresql][:dir]}

Tested on Scientific Linux 6.2.