Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Log files log.1 and log rotating

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
aaron

Log files log.1 and log rotating

#1 Post by aaron »

I have been looking around for the solution to this all over, but to no avail. Here's what I have.

I'm running woody on a production system. I did some upgrades (apt-get -u upgrade) and things went fine. But I've noticed a new problem with my log files. I'm not sure if anything in the upgrade had something to do with it.

The files were rotated last on what looks like 2005-08-21. As usual the current log file got renamed to *.log.1 and a new log file was created. For example, apache access log was access.log and was backed up to access.log.1 and a new access.log was created.

Well, here is the problem. The new log file was created but it's not being used. Everything is getting logged into the *.log.1 file and nothing to the new *.log file. This is happening with ALL log files that have been rotated. I've tried running logrotate manually but that doesn't seem to make a difference. I've not modified my logrotate conf file or cron or anything related since well before this started happening.

Any ideas and/or help here would be greatly appreciated.

Aaron

Jeroen
Debian Developer, Site Admin
Debian Developer, Site Admin
Posts: 483
Joined: 2004-04-06 18:19
Location: Utrecht, NL
Contact:

#2 Post by Jeroen »

Apache needs to reopen the logfiles -- otherwise the logging file descriptor will move along with the roted logfiles.

TYpically, in your logrotate.d/apache config file, you'll therefore have something like:

Code: Select all

    postrotate
        /etc/init.d/apache reload > /dev/null
    endscript
Inside the stanza for your apache logs.

aaron

#3 Post by aaron »

Yep. I sure do. Have that exactly. I haven't modified the log rotation files for several months, so I'm not sure why all files (not just apache) are logging to old *.log.1 files.

Jeroen
Debian Developer, Site Admin
Debian Developer, Site Admin
Posts: 483
Joined: 2004-04-06 18:19
Location: Utrecht, NL
Contact:

#4 Post by Jeroen »

Did you try manually reloading apache? And restarting it? Maybe that somehow errors out or something?

aaron
Posts: 2
Joined: 2005-09-07 19:25

#5 Post by aaron »

By manually reloading, do you mean re-installing or doing a manual stop & start? If you mean the stop/restart, yes. I've tried that and I've tried rebooting and manually running logrotate, but nothing changes.

I'm also getting the same behavior in the kernel.log, cups log, auth log, daemon log, debug log, etc., etc.

Jeroen
Debian Developer, Site Admin
Debian Developer, Site Admin
Posts: 483
Joined: 2004-04-06 18:19
Location: Utrecht, NL
Contact:

#6 Post by Jeroen »

kernel log, daemon log, syslog and the likes are all controlled by syslog, and not by logrotate. Anyway, rebooting and then services still writing to access.log.0 instead of access.log? I can't believe that, to be honest, unless you put that in your apache.conf. Please try to get clear what stage exactly goes wrong, or it'll be very hard to give help. Also note that logrotate will typically not rotate unless really a day has passed, no matter how often you invoke it.

aaron
Posts: 2
Joined: 2005-09-07 19:25

#7 Post by aaron »

Yes, I've check all syslog.conf and apache.conf files to ensure the logging is set to *.log and not *.log.1. All are ok and have not been modified for some time.

I will try another reboot and see if it will clear it up. Thanks for the help & suggestions.

Post Reply