10.6. Troubleshooting problems related to fapolicyd
The fapolicyd application framework provides tools for troubleshooting the most common problems and you can also add applications installed with the rpm command to the trust database.
- Installing applications by using RPM
If you install an application by using the
rpmcommand, you have to perform a manual refresh of thefapolicydRPM database:Install your <application>:
# rpm -i <application>.rpmRefresh the database:
# fapolicyd-cli --updateIf you skip this step, the system can freeze and must be restarted.
- Service status
If
fapolicyddoes not work correctly, check the service status:# systemctl status fapolicydfapolicyd-clichecks and listingsThe
--check-config,--check-watch_fs, and--check-trustdboptions help you find syntax errors, not-yet-watched file systems, and file mismatches, for example:# fapolicyd-cli --check-config Daemon config is OK # fapolicyd-cli --check-trustdb /etc/selinux/targeted/contexts/files/file_contexts miscompares: size sha256 /etc/selinux/targeted/policy/policy.31 miscompares: size sha256Use the
--listoption to check the current list of rules and their order:# fapolicyd-cli --list … 9. allow perm=execute all : trust=1 10. allow perm=open all : ftype=%languages trust=1 11. deny_audit perm=any all : ftype=%languages 12. allow perm=any all : ftype=text/x-shellscript 13. deny_audit perm=execute all : all …
- Debug mode
Debug mode provides detailed information about matched rules, database status, and more. To switch
fapolicydto debug mode:Stop the
fapolicydservice:# systemctl stop fapolicydUse debug mode to identify a corresponding rule:
# fapolicyd --debugBecause the output of the
fapolicyd --debugcommand is verbose, you can redirect the error output to a file:# fapolicyd --debug 2> fapolicy.outputAlternatively, to limit the output only to entries when
fapolicyddenies access, use the--debug-denyoption:# fapolicyd --debug-deny
- Removing the
fapolicyddatabase To solve problems related to the
fapolicyddatabase, try to remove the database file:# systemctl stop fapolicyd # fapolicyd-cli --delete-db주의Do not remove the
/var/lib/fapolicyd/directory. Thefapolicydframework automatically restores only the database file in this directory.- Dumping the
fapolicyddatabase The
fapolicydcontains entries from all enabled trust sources. You can check the entries after dumping the database:# fapolicyd-cli --dump-db- Application pipe
In rare cases, removing the
fapolicydpipe file can solve a lockup:# rm -f /var/run/fapolicyd/fapolicyd.fifo