Does selinux check context on the whole directory hierarchy when making a decision about permission to enter a directory? That is, when I try to access /home/Data/pgsql, will it check the context on /home, then /home/Data, and then on /home/Data/pgsql? Or will it only check the context on /home/Data/pgsql?
<br><br>I want to put a Postgres database in a /home/Data/pgsql/data directory, but the initrc script will not run it there. I can run it as the postgres user. The contexts mirror the /var/lib/pgsql/data directory: user_u:object_r:postgres_db_t. The context of /home/Data/pgsql is system_u:object_r:var_lib_t.  
<br><br>It does run fine with initrc in /var/lib/pgsql. When I leave the pgstartup.log in /var/lib/pgsql, I see the errors below. It doesn't matter whether the database is already initialized or not. The contexts for the /home/Data/pgsql directory are listed below as well. /home/Data is system_u:object_r:user_home_dir_t.
<br><br>I don't see anything in /var/log/audit/audit.log, but I think dontaudit rules may  be in effect.<br><br>Does Fedora use the reference policy from Tresys exactly? If not, where can I find the source policy for Fedora. All I can find are the if files. 
<br><br>Finally, are there any better references for selinux. Everything I've read seems dated.<br><br>Thanks,<br>Jim Young<br><br>pgstartup.log:<br>-------------------------<br>could not change directory to "/home/Data/pgsql"
<br>initdb: could not access directory "/home/Data/pgsql/data": Permission denied<br>The files belonging to this database system will be owned by user "postgres".<br>This user must also own the server process.
<br><br>The database cluster will be initialized with locale en_US.UTF-8.<br>The default database encoding has accordingly been set to UTF8.<br><br>postmaster cannot access the server configuration file "/home/Data/pgsql/data/postgresql.conf": Permission denied
<br>could not change directory to "/home/Data/pgsql"<br>initdb: could not access directory "/home/Data/pgsql/data": Permission denied<br>The files belonging to this database system will be owned by user "postgres".
<br>This user must also own the server process.<br><br>The database cluster will be initialized with locale en_US.UTF-8.<br>The default database encoding has accordingly been set to UTF8.<br><br>postmaster cannot access the server configuration file "/home/Data/pgsql/data/postgresql.conf": Permission denied
<br>-----------<br><br>directory contexts:<br>-------------------------------<br>ls -Zd /home/Data/pgsql<br>drwx------  postgres postgres system_u:object_r:var_lib_t      /home/Data/pgsql<br><br>ls -Z /home/Data/pgsql<br>
drwx------  postgres postgres system_u:object_r:var_lib_t      backups<br>drwx------  postgres postgres system_u:object_r:postgresql_db_t data<br>-rw-------  postgres postgres system_u:object_r:postgresql_log_t pgstartup.log
<br><br>ls -Z /home/Data/pgsql/data<br>drwx------  postgres postgres user_u:object_r:postgresql_db_t  base<br>drwx------  postgres postgres user_u:object_r:postgresql_db_t  global<br>drwx------  postgres postgres user_u:object_r:postgresql_db_t  pg_clog
<br>-rw-------  postgres postgres user_u:object_r:postgresql_db_t  pg_hba.conf<br>-rw-------  postgres postgres user_u:object_r:postgresql_db_t  pg_ident.conf<br>drwx------  postgres postgres user_u:object_r:postgresql_db_t  pg_log
<br>drwx------  postgres postgres user_u:object_r:postgresql_db_t  pg_multixact<br>drwx------  postgres postgres user_u:object_r:postgresql_db_t  pg_subtrans<br>drwx------  postgres postgres user_u:object_r:postgresql_db_t  pg_tblspc
<br>drwx------  postgres postgres user_u:object_r:postgresql_db_t  pg_twophase<br>-rw-------  postgres postgres user_u:object_r:postgresql_db_t  PG_VERSION<br>drwx------  postgres postgres user_u:object_r:postgresql_db_t  pg_xlog
<br>-rw-------  postgres postgres user_u:object_r:postgresql_db_t  postgresql.conf<br>-rw-------  postgres postgres user_u:object_r:postgresql_db_t  postmaster.opts<br><br><br>