I have Centos 7 fresh install and I see setroubleshootd with high CPU usage. How can I fix this? What is this process doing?
First of all, you should not disable SELinux. So what could cause the high CPU usage of
Try to find out in which mode SELinux is running on the machine by typing
sestatus. It should show several lines. The interesting parts are
SELinux status: and
Current Mode which are usually
enforcing. If the current mode is
permissive, then SELinux does not block anything but only logs it (good for troubleshooting).
Assuming SELinux is enabled and in in enforcing mode, now take a look at the log
/var/log/audit/audit.log. I would recommend to use
tail -f /var/log/audit/audit.log to see live changes of the file.
Because you have high CPU load of
setroubleshootd I assume you have permanent changes/entries in the file, meaning something permanently violates the SELinux policy and the output could give you a first clue why.
For more in depth troubleshooting you could install
yum install setroubleshoot-server. This package is a set of tools that can help you to find the real cause of the SELinux violation. Most of the time it happens when you added files to the system without setting the correct SELinux permissions or a process tries to access a non typical file or folder.
There is a bit of a learning curve with SELinux and too much for a simple answer, but I would never ever disable it on a public facing server.
setroubleshoot.x86_64 for a GUI; this might be easier than using
# yum install setroubleshoot.x86_64 setroubleshoot-plugins.noarch
Adding SE Linux policies for
mongodb (and possible others) might reduce the load.
Please note that the suggestions it makes can sometimes be useless/misleading.
setroubleshootd might be an option:
yum reinstall setroubleshoot-server
setroubleshootd is part of SELinux (Security Enhanced Linux). SELinux was implented to provide a context type to files to add more security and comply with NSA requirements. SELinux can cause issues if not properly configured and employed. Setroubleshootd monitors and reports SELinux issues, and provides resolution recommendations.
Determine if you actually need SELinux to run. If not, disable it.
Click here for more info on Disabling SELinux.