LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-20-2007, 11:16 AM   #1
apachenew
Member
 
Registered: Jul 2007
Posts: 30

Rep: Reputation: 15
after setting up logrotate for apache, logging stops


Hello,
Our Redhat ES 4 Linux box's apache 2.2.6 was compiled so the apache logs weren't being rotated automatically. So I've created a logrotate by creating a file inside of /etc/logrotate.d/ directory as:

/etc/logrotate.d/apache

/wwwroot/logs/access_log /wwwroot/logs/error_log /wwwroot/logs/ssl_request_log {
weekly
compress
missingok
notifempty
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
}

It rotates now but as it's rotated, the apache logging stops and doesn't log anymore until I manually restart apache.
Is there something wrong with the file I created for rotation?
The access_log, error_log, and ssl_request_log are all 0 at this point until I restart apache:

-rw-r--r-- 1 root root 0 Nov 18 04:02 access_log
-rw-r--r-- 1 root root 3220179 Nov 18 04:02 access_log.1.gz
-rw-r--r-- 1 root root 240854649 Nov 11 04:05 access_log.2.gz
-rw-r--r-- 1 root root 0 Nov 18 04:02 error_log
-rw-r--r-- 1 root root 1327595 Nov 18 04:02 error_log.1.gz
-rw-r--r-- 1 root root 61193640 Nov 11 04:06 error_log.2.gz
-rw-r--r-- 1 root root 5 Nov 15 18:50 httpd.pid
-rw-r--r-- 1 root root 0 Nov 18 04:02 ssl_request_log
-rw-r--r-- 1 root root 3057768 Nov 18 04:02 ssl_request_log.1.gz
-rw-r--r-- 1 root root 211737132 Nov 11 04:10 ssl_request_log.2.gz

Any suggestions?
 
Old 11-20-2007, 11:48 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Add a postrotate entry for apache? Apache is actually still
logging, just to an unlinked file. You'll probably notice that
the disk-space is slowly decreasing ;}

I don't know the init-structure of RH, but on debian the entry
for logrotate looks something like:
Code:
/var/log/apache/*.log {
        weekly
        missingok
        rotate 52
        compress
        delaycompress
        notifempty
        create 640 root adm
        sharedscripts
        postrotate
           if [ -f /var/run/apache.pid ]; then \
             if [ -x /usr/sbin/invoke-rc.d ]; then \
                invoke-rc.d apache reload > /dev/null; \
             else \
                /etc/init.d/apache reload > /dev/null; \
             fi; \
           fi;
        endscript
}
You get the idea - and restarting syslog for apache shouldn't
be necessary.



Cheers,
Tink
 
Old 11-26-2007, 10:59 AM   #3
apachenew
Member
 
Registered: Jul 2007
Posts: 30

Original Poster
Rep: Reputation: 15
Thanks, it must've been the postrotate entry.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache crash on cron->logrotate (weekly) pezzer55 Linux - Software 7 09-30-2008 07:58 PM
Pix logging on syslog... logrotate does not work logicalfuzz Linux - Software 0 03-06-2006 12:04 AM
LogRotate Webmin - Apache Crashes brooky Linux - Software 0 04-26-2004 02:16 AM
Apache logrotate teeno Linux - Software 4 08-06-2003 10:51 PM
Apache logging stops at 4k boundaries shilbert Linux - Software 2 06-26-2003 12:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:48 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
Open Source Consulting | Domain Registration