zappp
01-15-2004, 07:14 PM
Ok, here is my problem.
Recenty I setuped logrotate twice per day: at 5am and 5pm.
Here is an apache logrotate config:
/home/www/www1/logs/access_log {
size 100M
nocompress
rotate 2
postrotate
/bin/kill -HUP `cat /usr/local/apache/logs/httpd.pid 2>/dev/null` 2> /dev/null || true
endscript
}
in the morning it works fine: rotate logs and apache still working. but in the evening... it is still rotate the logs (access_log->access_log.1), created access_log with zero size and nothing else: apache is not working. I am seeing one apache process but when I'm trying to open site through browser it wont work.
ofcourse the first thing I tried is to restart apache:
/usr/local/apache/bin/apachectl stop
/usr/local/apache/bin/apachectl stop: httpd stopped
/usr/local/apache/bin/apachectl start
/usr/local/apache/bin/apachectl start: httpd (pid 991) already running
so it wont work either.
it start working when i manually killing this one httpd process and doing apachectl stop, start again.
So what should I do to not crashing apache after logrotate?
Thanks!
Recenty I setuped logrotate twice per day: at 5am and 5pm.
Here is an apache logrotate config:
/home/www/www1/logs/access_log {
size 100M
nocompress
rotate 2
postrotate
/bin/kill -HUP `cat /usr/local/apache/logs/httpd.pid 2>/dev/null` 2> /dev/null || true
endscript
}
in the morning it works fine: rotate logs and apache still working. but in the evening... it is still rotate the logs (access_log->access_log.1), created access_log with zero size and nothing else: apache is not working. I am seeing one apache process but when I'm trying to open site through browser it wont work.
ofcourse the first thing I tried is to restart apache:
/usr/local/apache/bin/apachectl stop
/usr/local/apache/bin/apachectl stop: httpd stopped
/usr/local/apache/bin/apachectl start
/usr/local/apache/bin/apachectl start: httpd (pid 991) already running
so it wont work either.
it start working when i manually killing this one httpd process and doing apachectl stop, start again.
So what should I do to not crashing apache after logrotate?
Thanks!
