Why does Red Hat Satellite 5.6 installation fail with SELinux errors when using a separate filesystem for the PostgreSQL database?
Issue
- When installing Satellite 5.6 using the embedded PostgreSQL database I get the following error message:
* Setting up Selinux..
** Database: Setting up database connection for PostgreSQL backend.
** Database: Installing the database:
** Database: This is a long process that is logged in:
** Database: /var/log/rhn/install_db.log
*** Progress: #
Could not install database.
- Checking the resulting
/var/log/rhn/install_db.loglog file shows that the installer is complaining about incorrect security context in/var/lib/pgsql:
# cat /var/log/rhn/install_db.log
The directory "/var/lib/pgsql" does not seem to have correct SELinux context.
Please fix the SELinux context by running:
restorecon -Rv /var/lib/pgsql
- Security contexts in
/var/lib/pgsqlseem correct:
# ls -ldZ /var/lib/pgsql
drwx------. postgres postgres system_u:object_r:postgresql_db_t:s0 /var/lib/pgsql
#
# ls -lZ /var/lib/pgsql
drwx------. postgres postgres system_u:object_r:postgresql_db_t:s0 backups
drwx------. postgres postgres system_u:object_r:postgresql_db_t:s0 data
drwx------. root root system_u:object_r:lost_found_t:s0 lost+found
-rw-------. postgres postgres unconfined_u:object_r:postgresql_log_t:s0 pgstartup.log
- Applying the command suggested by
/var/log/rhn/install_db.logchanges the security context oflost+founddirectory and allows the installation to proceed.
# restorecon -Rv /var/lib/pgsql
restorecon reset /var/lib/pgsql/lost+found context system_u:object_r:lost_found_t:s0->system_u:object_r:postgresql_db_t:s0
- Should not
lost-founddirectory havesystem_u:object_r:lost_found_t:s0security context?
Environment
- Red Hat Satellite 5.6
- Embedded PostgreSQL database.
- Separate
/var/lib/pgsqlfilesystem. - selinux-policy version .
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
