Description of problem: Seeing this when I close the lid on my laptop: avc: denied { write } for pid=15191 comm="sleep.sh" name="sleep.log" dev="sda8" ino=792198 scontext=system_u:system_r:apmd_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file coming from /etc/acpi/actions/sleep.sh. In permissive I get: type=AVC msg=audit(1379087014.778:876): avc: denied { write } for pid=25933 comm="sleep.sh" name="sleep.log" dev="sda8" ino=792198 scontext=system_u:system_r:apmd_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file type=AVC msg=audit(1379087014.778:876): avc: denied { open } for pid=25933 comm="sleep.sh" path="/var/log/sleep.log" dev="sda8" ino=792198 scontext=system_u:system_r:apmd_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file /var/log/sleep.log already existed at that point, but wouldn't necessarily on a newly installed system. Version-Release number of selected component (if applicable): acpid-2.0.19-6.fc19.i686 selinux-policy-3.12.1-74.3.fc19.noarch
Where does /etc/acpi/actions/sleep.sh come from, it looks like we need label for /var/log/sleep.log apmd_log_t If you renamed this to /var/log/acpid.sleep.log it would be labeled correctly. Or semanage fcontext -a -t apmd_log_t '/var/log/sleep\.log' restorecon -R -v /var/log/sleep.log
Sorry, I had thought this script was part of acpid, but it is our own custom script - so we need our own policy - or use the acpid.sleep.log name - thanks for that.