Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I found a command '/usr/sbin/logrotate' running on my machine(redhat 7.3) again and again. every time it eats more than 95% CPU time and runs a long long time! i killed it, but it will run again and again. this nearly drives me out of my mind. who can tell me what's the problem and how to fix it?
Logrotate is a program that will periodically compress or delete your log files so that they don't wind up consuming your entire harddrive.
All the log files is works on are found in /var/log
However, when it takes forever and ever, it is most likely that you have used up most of your harddrive space and it is madly swapping stuff in and out of virtual memory in order to get the job done.
Also, you may have a misconfigured logrotate.
First of all you should do "man logrotate" to learn about logrotate (it is a good thing, trust me).
Then you should do a "df", which will show you how much free space you have on disk. If you disk usage is near 100% you have a problem.
Also, take a look at the logs in /var/log/mail, /var/log/news etc..., sometimes with a misconfigured logrotate it can end up re-compressing the same files over and over again leading to hundreds of files something like this:
mail.1.gz
mail.1.gz.gz
mail.1.gz.gz.gz
mail.1.gz.gz.gz.gz
mail.1.gz.gz.gz.gz.gz...
....etc you get the picture...
Hunt around in your /var/log directory, if you see stuff like this for other logs as well, it's a good bet you have a misconfigured logrotate that is uselessly compressing the same file over and over again.
IIRC, the config file should be: /etc/logrotate.conf or something (there may be a config directory in /etc for logrotate, it should be easy to find...)
Anyways, if logrotate is misconfigured you will need to edit the config file to be more specific (i.e. instead of having it rotate /var/log/mail/mail.*, specify explicitly only the log files you want it to rotate) or to delete logs rather than compress them (if you really don't need a 4 month log trace or whatever...)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.