SUSE / openSUSEThis Forum is for the discussion of Suse Linux.
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 have a SUSE system that is going wild with the logs. The logs were being rotated at one time but they no longer are. The disk is only 2.0GB, I can't take the server down because this is a live server that requires 24/7 operation and a downtime of no more then 5min per year. I can't drop to single user mode, because this system is accessed by users at all times, even during night. Below you will see that I have one file that refuses to rotate.
Here is what I put in logrotate. I recently modified and removed the dateext because it was driving me crazy anyway but I know it has nothing to do with the logs are they are now. I also changed to daily from weekly to try and force it to rotate. Executed logroate -f /etc/longrotate.conf and it still exists. So what is the proper way to get this problem taken care of and make disk space more manageable. I didn't build this system, so I don't know who in their right mind would have thought at 2gb for /var would have been sufficient for the user loads on this system. (It's a CVS repository)
However I think the reason why this is coming about is because sometime ago I had to change the logrotate and manually delete some of the older files, ie( there were files on here from 2008) I figured I would only need a month's worth of pacct logs. After manually removing those files I think that is when this came about but not sure.
Running 'logrotate -df /etc/logrotate.d/pacct 2>&1 | tee /tmp/logrotate.dbg' (or psacct?) should get you infos in /tmp/logrotate.dbg to look at (and post?) because I can't see anything wrong with this.
cat /tmp/logrotate.dbg
reading config file /etc/logrotate.d/acct
reading config info for /var/account/pacct
error: line too long in state file /var/lib/logrotate.status
After seeing the line to long error I deleted the logrotate.status file, logrotate was able to execute and then I got this.
Code:
logrotate -df /etc/logrotate.d/acct 2>&1 | tee /tmp/logrotate.dbg
reading config file /etc/logrotate.d/acct
reading config info for /var/account/pacct
error: line too long in state file /var/lib/logrotate.status
solssvdev:/var/log# cat /tmp/logrotate.dbg
reading config file /etc/logrotate.d/acct
reading config info for /var/account/pacct
error: line too long in state file /var/lib/logrotate.status
solssvdev:/var/log# cat /tmp/logrotate.dbg
reading config file /etc/logrotate.d/acct
reading config info for /var/account/pacct
error: line too long in state file /var/lib/logrotate.status
solssvdev:/var/log# cp /var/lib/logrotate.status /root/
solssvdev:/var/log# rm /var/lib/logrotate.status
solssvdev:/var/log# logrotate -df /etc/logrotate.d/acct 2>&1 | tee /tmp/logrotate.dbg
reading config file /etc/logrotate.d/acct
reading config info for /var/account/pacct
Handling 1 logs
rotating pattern: /var/account/pacct forced from command line (7 rotations)
empty log files are not rotated, old logs are removed
considering log /var/account/pacct
log needs rotating
rotating log /var/account/pacct, log->rotateCount is 7
previous log /var/account/pacct.1 does not exist
renaming /var/account/pacct.7.gz to /var/account/pacct.8.gz (rotatecount 7, logstart 1, i 7),
renaming /var/account/pacct.6.gz to /var/account/pacct.7.gz (rotatecount 7, logstart 1, i 6),
renaming /var/account/pacct.5.gz to /var/account/pacct.6.gz (rotatecount 7, logstart 1, i 5),
renaming /var/account/pacct.4.gz to /var/account/pacct.5.gz (rotatecount 7, logstart 1, i 4),
renaming /var/account/pacct.3.gz to /var/account/pacct.4.gz (rotatecount 7, logstart 1, i 3),
renaming /var/account/pacct.2.gz to /var/account/pacct.3.gz (rotatecount 7, logstart 1, i 2),
renaming /var/account/pacct.1.gz to /var/account/pacct.2.gz (rotatecount 7, logstart 1, i 1),
renaming /var/account/pacct.0.gz to /var/account/pacct.1.gz (rotatecount 7, logstart 1, i 0),
renaming /var/account/pacct to /var/account/pacct.1
creating new log mode = 0640 uid = 0 gid = 0
running postrotate script
running script with arg /var/account/pacct: "
/etc/init.d/acct force-reload
"
removing old log /var/account/pacct.8.gz
So that means I need to change it back to what it was and hope it works.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.