Hide Forgot
Description of problem: I noticed that postgresql wasn't starting in rawhide in enforcing mode, but was in permissive mode. audit2allow showed the following permissions were needed to start it. #============= postgresql_t ============== allow postgresql_t tmp_t:file { read unlink open }; allow postgresql_t tmp_t:sock_file unlink; Version-Release number of selected component (if applicable): selinux-policy-targeted-3.10.0-86.fc17.noarch postgresql-server-9.1.2-2.fc17.i686 How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Could you attach raw AVC messages?
/var/log/audit/audit.log:type=AVC msg=audit(1329059471.043:263872): avc: denied { read } for pid=7619 comm="postgres" name=".s.PGSQL.5432.lock" dev="dm-0" ino=1704128 scontext=system_u:system_r:postgresql_t:s0 tcontext=system_u:object_r:tmp_t:s0 tclass=file /var/log/audit/audit.log:type=AVC msg=audit(1329059513.193:263875): avc: denied { read } for pid=7859 comm="postgres" name=".s.PGSQL.5432.lock" dev="dm-0" ino=1704128 scontext=system_u:system_r:postgresql_t:s0 tcontext=system_u:object_r:tmp_t:s0 tclass=file /var/log/audit/audit.log:type=AVC msg=audit(1329059513.193:263876): avc: denied { open } for pid=7859 comm="postgres" name=".s.PGSQL.5432.lock" dev="dm-0" ino=1704128 scontext=system_u:system_r:postgresql_t:s0 tcontext=system_u:object_r:tmp_t:s0 tclass=file /var/log/audit/audit.log:type=AVC msg=audit(1329059513.206:263877): avc: denied { unlink } for pid=7859 comm="postgres" name=".s.PGSQL.5432.lock" dev="dm-0" ino=1704128 scontext=system_u:system_r:postgresql_t:s0 tcontext=system_u:object_r:tmp_t:s0 tclass=file /var/log/audit/audit.log:type=AVC msg=audit(1329059513.259:263878): avc: denied { unlink } for pid=7859 comm="postgres" name=".s.PGSQL.5432" dev="dm-0" ino=1715717 scontext=system_u:system_r:postgresql_t:s0 tcontext=system_u:object_r:tmp_t:s0 tclass=sock_file
Can you remove the contents of /tmp and try again. I think this was probably caused by all of the systemd problems we were having and now you have mislabeled sockets in /tmp/
I tried your suggestion (shutting down postgresql, removing stuff in /tmp and my module that allowed the access while waiting for a fix, and then starting postgresql) and it worked. So I am going to close this as not a bug. Thanks for the help.