LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-03-2003, 10:37 AM   #16
satman
LQ Newbie
 
Registered: Jan 2003
Posts: 2

Rep: Reputation: 0
Unhappy


... and if this is not enough, after logrotate is finished, slocate is taking its turn:

120 processes: 118 sleeping, 2 running, 0 zombie, 0 stopped
CPU states: 2.1% user, 97.4% system, 0.0% nice, 0.3% idle
Mem: 62080K av, 60456K used, 1624K free, 50092K shrd, 11796K buff
Swap: 265032K av, 125612K used, 139420K free 14644K cached

PID USER PRI NI SIZE RSS SHARE STAT LIB %CPU %MEM TIME COMMAND
11200 root 20 0 42636 4368 52 R 0 95.6 7.0 111:58 slocate
12450 root 5 0 904 904 668 R 0 2.1 1.4 0:03 top



satman
 
Old 03-04-2003, 04:35 PM   #17
DickieRay
LQ Newbie
 
Registered: Mar 2003
Distribution: Red Hat
Posts: 1

Rep: Reputation: 0
logrotate.status problem

From this thread and this other thread

https://listman.redhat.com/pipermail...er/017582.html

I have a solution in place.

Remove mailman: rpm -e mailman
Remove mailman logs: rm -rf /var/log/mailman
Rename logrotate.status file: mv /var/lib/logrotate.status /var/lib/logrotate.status.old

Running /etc/cron.daily/logrotate seems just fine now.
 
Old 04-21-2003, 11:59 AM   #18
eafritz
LQ Newbie
 
Registered: Apr 2003
Posts: 1

Rep: Reputation: 0
I'm having the same problem. I applied a fix to the mailman logrotate configuration which solved the problem of the mailman directory getting massive, however every monday morning my logrotate is still going wild for several hours, taking 99% of my cpu.

Anybody know why it would run like this for hours? I get the same output from the "ps ax -eo pid,args --forest" command as noted above but don't really like the solution suggested (looks too much like a hack, but then again maybe I just don't understand it properly)

One thing to note is that based on the /var/lib/logrotate.status command, it "looks" like it is working on /var/log/cron but it is hard to tell as that file has no timestamps in it. The cron file is about 1.5 Mb but it shouldn't take hours to process it...

Any ideas?

NOTE: the fix to the mailman logrotate config file I mentioned is to change the file /etc/logrotate.d/mailman from:

/var/log/mailman/* {
missingok
}

to be:

/var/log/mailman/bounce {
missingok
}
/var/log/mailman/digest {
missingok
}
/var/log/mailman/error {
missingok
}
/var/log/mailman/post {
missingok
}
/var/log/mailman/smtp-failure {
missingok
}
/var/log/mailman/locks {
missingok
}
/var/log/mailman/fromusenet {
missingok
}
/var/log/mailman/subscribe {
missingok
}
/var/log/mailman/vette {
missingok
}

From what i can tell the logrotate program interprets the original file such that it trys to "rotate" all the already rotated files and basically gets into a rescursive nightmare.
 
Old 04-21-2003, 02:25 PM   #19
jmckeand
LQ Newbie
 
Registered: Nov 2002
Location: Crofton, MD
Distribution: RedHat 9.0
Posts: 15

Rep: Reputation: 0
I've had this problem on and off for quite a while. The last time my problem was an excessive (millions) of 0 size vgetty.log files. This lead into a need to run disk utilities to fix some corrupted files and directories (/var/log for one) - won't get into that. Once the files were gone the problem seemed to vanish.

Then it restarted after upgrading to RH9. I could run the command:

logrotate -v /etc/logrotate.conf

Which is similar to what the cron job runs, I added the -v to get a verbose output. But, it would hang after reading the conf files.

I followed DickieRay's renaming the logrotate.status file. Now the above command runs fine - at least it does not hang. I will have to wait to see what happens tonight.

Is there any reason to keep the old logrotate.status file? The old file is 20M - mostly because of the vgetty problem I was having.
 
Old 08-29-2003, 02:56 PM   #20
kingroom
LQ Newbie
 
Registered: Aug 2003
Posts: 3

Rep: Reputation: 0
DickieRay gave the correct answer. thinks to him/her.


Remove mailman: rpm -e mailman
Remove mailman logs: rm -rf /var/log/mailman
Rename logrotate.status file: mv /var/lib/logrotate.status /var/lib/logrotate.status.old

Running /etc/cron.daily/logrotate seems just fine now.
 
Old 07-15-2004, 01:02 PM   #21
ne1scott
LQ Newbie
 
Registered: Jul 2003
Distribution: Red Hat
Posts: 11

Rep: Reputation: 0
Redhat 7.3 Logrotate fix

This is pasted from a document I wrote in January. (I attached a script that does it automatically at the bottom of this reply, but you may have to fix carriage returns)
-----------------------------------------------------------------------------------------------

Fixing Logrotate Issues on RedHat Linux 7.3
WARNING: DO NOT PLACE ANY EXTRA FILES OR BACKUP FILES IN THE /ETC/LOGROTATE.D DIRECTORY !! Every file in the /etc/logrotate.d directory will be executed by logrotate on a daily basis no matter what it is named.

Note: This fix is intended for all Redhat Linux 7.3 machines. This fix only needs to be performed one time to permanently fix the logrotate problems Redhat Linux 7.3 systems experience.

It will prevent future problems as well as cleaning up the complicated mess the logrotate problems left behind and stopping the 0% idle issues.

Performing the fix manually
1. Use the "service syslog stop" command to stop the syslog process.

2. Use “rm –rf /var/log/mailman” to remove the entire mailman directory so that disk space and inodes can be freed up. This may take 5 to 10 minutes if your system was almost out of inodes. When the prompt comes back, check to see if the mailman directory is gone by using the command “ls –ld /var/log/mailman”. If the mailman directory is gone, then proceed to step 3, otherwise you may have to use the command "find /var/log/mailman -name error\* -exec /bin/rm {} \;" to reduce the number of error logs in the directory before you try removing it again with the command at the beginning of step 2.

3. Use “find /var/log/ -name “mgetty*” –exec /bin/rm {} \;” to remove all of the mgetty logs in the /var/log directory.

WARNING: DO NOT PLACE ANY EXTRA FILES OR BACKUP FILES IN THE /ETC/LOGROTATE.D DIRECTORY !! Every file in the /etc/logrotate.d directory will be executed by logrotate on a daily basis no matter what it is named.

4. Replace the /etc/logrotate.d/mgetty file with a fixed version or replace the contents of the /etc/logrotate.d/mgetty file with the following text :
#
# Rotate mgetty log files.
#
/var/log/mgetty.log.ttyS? {
nocompress
missingok
}
The permissions listed by "ls -la /etc/logrotate.d/mgetty" should be 644 (-rwr--r-- root root).
Use "chmod 644 /etc/logrotate.d/mgetty", "chown root /etc/logrotate.d/mgetty", and "chgrp root /etc/logrotate.d/mgetty" to
change it if necessary.

5. Replace the /etc/logrotate.d/vgetty file with a fixed version or replace the contents of the /etc/logrotate.d/vgetty file with the following text :
#
# Entry for rotating vgetty log files.
#
/var/log/vgetty.log.tty[^.] /var/log/vgetty.log.tty[^.][^.]
/var/log/vgetty.log.
tty[^.][^.][^.] {
nocompress
missingok
}
The permissions listed by "ls -la /etc/logrotate.d/vgetty" should be 644 (-rwr--r-- root root).

Use "chmod 644 /etc/logrotate.d/vgetty", "chown root /etc/logrotate.d/vgetty", and "chgrp root /etc/logrotate.d/vgetty" to
change it if necessary.

6. Replace the /etc/logrotate.d/mailman file with a fixed version or replace the contents of the /etc/logrotate.d/mailman file with the following text :
/var/log/mailman/bounce {
missingok
}
/var/log/mailman/digest {
missingok
}
/var/log/mailman/error {
missingok
}
/var/log/mailman/post {
missingok
}
/var/log/mailman/smtp-failure {
missingok
}
/var/log/mailman/locks {
missingok
}
/var/log/mailman/fromusenet {
missingok
}
/var/log/mailman/subscribe {
missingok
}
/var/log/mailman/vette {
missingok
}

The permissions listed by "ls -la /etc/logrotate.d/mailman" should be 644 (-
rw-r--r-- root root).
If they need changed, use "chmod 644 /etc/logrotate.d/mailman", "chown
root /etc/logrotate.d/mailman", and "chgrp root /etc/logrotate.d/mailman", to change them.

7. Remove the logrotate cache files by using the following commands :
Change to the /var/lib directory using “cd /var/lib”
Remove the mgetty lines from the logrotate.status file using the commands :
wc -l logrotate.status (to see how many lines are in it to begin with)
cat logrotate.status | grep -v mgetty > tmpfile
cat tmpfile | grep -v mailman > tmpfile2
cp -f tmpfile2 logrotate.status
rm -f tmpfile tmpfile2
wc -l logrotate.status (to see how many lines are in it now)

Note : If there are still more than a couple of hundred lines in this file then you should view the file and see what process is creating large numbers of entries. Usually mgetty is the only guilty process.

You can use the same commands as above to remove another process’s entries but you shouldn’t ever need to this. Contact Interact if it looks like something else besides mgetty is creating thousands of log entries.

8. Re-create the mailman directory and set its permissions.
cd /var/log
mkdir mailman
chmod 2775 mailman
chgrp mailman mailman
ls -ld mailman (to verify “drwxrwsr-x root mailman” permissions)

9. Optionally remove the excess log files in the /var/log directory.
rm -f /var/log/*.?
rm -f /var/log/*.??

10. Use "service syslog start" to start the syslog process again using the new files.

11. Remove the Logrotate_Fix directory since it is no longer needed.
rm -rf /root/Logrotate_Fix

12. It is recommended that you reboot the system so that any negative effects from the logrotate problem
will no longer impact the system.

The logrotate fix has now been completed.
--------------------------------------------------------------------------------------------------
fix_logrotate script - To be put in a new directory named /root/Logrotate_Fix
--------------------------------------------------------------------------------------------------
#!/bin/bash
#
/usr/bin/clear
#
# Stop the syslog service so that more system logs are not written.
/sbin/service syslog stop
/bin/sleep 3

# Remove the mailman directory to free up disk space and inodes.
if [ -d /var/log/mailman ]
then
rm -rf /var/log/mailman
if [ -d /var/log/mailman ]
then
echo "Removal of the /var/log/mailman directory failed"
echo ""
echo "Trying to remove the files from /var/log/mailman, and then"
echo "trying to remove the directory again"
echo ""
/usr/bin/find /var/log/mailman -name error\* -exec /bin/rm {} \;
/bin/sleep 3
rm -rf /var/log/mailman
/bin/sleep 3
if [ -d /var/log/mailman ]
then
echo ""
echo "Unable to remove the /var/log/mailman directory."
echo "You may have to manually remove it"
echo ""
echo 'Continue the logrotate fix anyway ? Type "no" to exit'
echo ""
read resp0
if [ $resp0 == "n" ] || [ resp0 == "N" ]
then
exit 0
fi
fi
else
echo "The /var/log/mailman directory was deleted successfully"
fi
fi

# Remove the mgetty logs from /var/log since there may be thousands.
/usr/bin/find /var/log/ -name "mgetty.*" -exec /bin/rm {} \;

# Backup the original /etc/logrotate.d configuration files.
cp /etc/logrotate.d/mgetty /mgetty.OLD
cp /etc/logrotate.d/vgetty /vgetty.OLD
cp /etc/logrotate.d/mailman /mailman.OLD

# Replace the /etc/logrotate.d configuration files with fixed versions.
cp mgetty /etc/logrotate.d/
/bin/chmod 644 /etc/logrotate.d/mgetty
/bin/chown root /etc/logrotate.d/mgetty
/bin/chgrp root /etc/logrotate.d/mgetty

cp vgetty /etc/logrotate.d/
/bin/chmod 644 /etc/logrotate.d/vgetty
/bin/chown root /etc/logrotate.d/vgetty
/bin/chgrp root /etc/logrotate.d/vgetty

cp mailman /etc/logrotate.d/
/bin/chmod 644 /etc/logrotate.d/mailman
/bin/chown root /etc/logrotate.d/mailman
/bin/chgrp root /etc/logrotate.d/mailman

# Remove the mgetty and mailman entries from the logrotate cache file so that logrotate does not try to finish pending work.

/bin/cat /var/lib/logrotate.status | grep -v mgetty > tmpfile
/bin/cat tmpfile | grep -v mailman > tmpfile2
cp -f tmpfile2 /var/lib/logrotate.status
rm -f tmpfile tmpfile2

# Re-create the mailman directory and set the permissions for each of the fixed configuration files in the /etc/logrotate.d directory.

cd /var/log
/bin/mkdir mailman
/bin/chmod 2775 mailman
/bin/chgrp mailman mailman

# Optionally remove the excess log files in the /var/log directory.
echo ""
echo "Do you want to remove the excess logs from the /var/log directory y/n ?"
echo ""
read resp1
if [ $resp1 == "y" ] || [ $resp1 == "Y" ]
then
rm -f /var/log/*.?
rm -f /var/log/*.??
echo ""
echo "The excess logs in the /var/log directory were removed"
else
echo ""
echo "Skipped the removal of excess logs in the /var/log directory"
fi
echo ""

# Restart the syslog process so that the system starts logging everything again.

/sbin/service syslog start

# Remove the entire Logrotate_Fix directory since these files are no longer need
ed.
if [ -d /root/Logrotate_Fix ]
then
rm -rf /root/Logrotate_Fix
fi

# Prompt you to reboot the system
echo ""
echo "Do you want to reboot the system now y/n ?"
echo ""
read resp2
if [ $resp2 == "y" ] || [ $resp2 == "Y" ]
then
echo "Rebooting the system now !!"
/sbin/init 6
else
echo ""
echo "Skipped the system reboot. Please reboot as soon as possible"
fi

echo ""
echo ""
echo "The logrotate problem has now been fixed on this computer."
echo ""

exit 0
------------------------------------end fix_logrotate script------------------------------
/etc/logrotate.d/vgetty replacement - needs to be in the /root/Fix_Logrotate directory for the fix_logrotate script
------------------------------------------------------------------------------------------------
#
# Entry for rotating vgetty log files.
#

/var/log/vgetty.log.tty[^.] /var/log/vgetty.log.tty[^.][^.] /var/log/vgetty.log.tty[^.][^.][^.] {
nocompress
missingok
}
------------------------------------------------------------------------------------------------
/etc/logrotate.d/mgetty replacement - needs to be in the /root/Fix_Logrotate directory for the fix_logrotate script
------------------------------------------------------------------------------------------------
#
# Rotate mgetty log files.
#

/var/log/mgetty.log.ttyS? {
nocompress
missingok
}
------------------------------------------------------------------------------------------------
/etc/logrotate.d/mailman replacement - needs to be in the /root/Fix_Logrotate directory for the fix_logrotate script to run properly
------------------------------------------------------------------------------------------------
#
# Rotate mgetty log files.
#

/var/log/mgetty.log.ttyS? {
nocompress
missingok
}
[modemtest:~]# cat mailman
/var/log/mailman/bounce {
missingok
}
/var/log/mailman/digest {
missingok
}
/var/log/mailman/error {
missingok
}
/var/log/mailman/post {
missingok
}
/var/log/mailman/smtp-failure {
missingok
}
/var/log/mailman/locks {
missingok
}
/var/log/mailman/fromusenet {
missingok
}
/var/log/mailman/subscribe {
missingok
}
/var/log/mailman/vette {
missingok
}
--------------------------------------------end of required files --------------------------

Last edited by ne1scott; 07-15-2004 at 01:07 PM.
 
Old 01-22-2012, 06:12 AM   #22
ruslandem
LQ Newbie
 
Registered: Jan 2012
Posts: 1

Rep: Reputation: Disabled
Solved my problem:
Code:
echo:>/var/lib/logrotate.status
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
logrotate takes up 100% CPU indefinitely BroX Slackware 2 05-24-2005 04:32 AM
logrotate dominant Linux - Newbie 1 02-13-2004 10:28 AM
CPU at 100% along with non stop hard disk activity biotek1 Fedora 6 02-05-2004 09:27 PM
logrotate Rig24 Linux - Newbie 2 07-11-2003 06:08 AM
Need help with logrotate process eating 99.9% CPU glock19 Linux - General 5 12-30-2002 09:02 PM


All times are GMT -5. The time now is 12:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration