Troubleshooting: ausearch, sealert
Sign in to read this lesson
A service does not work and you suspect SELinux. In this lesson we learn how to find the evidence (AVC messages), how to turn it into plain language (sealert, audit2why) and how to choose the right fix. At the end we combine the whole unit into one diagnostic algorithm.
What you will learn
- SELinux denials are written to
/var/log/audit/audit.logas AVC messages:ausearch -m AVC -ts recent. sealert -a /var/log/audit/audit.log(packagesetroubleshoot-server) explains the cause and suggests a fix.audit2whytells the reason for an AVC: a wrong context, a disabled boolean, or no rule in the policy.- The order of fixes: restorecon / semanage fcontext → setsebool → semanage port → (last resort) a custom module.
- Building a module with
audit2allow -Mis the last option — do not blindly turn every AVC into an allow.
The lesson has 5 key points, an explanation and 5 questions. It opens with a package.