Apache stops after logrotate!

Ok, here is my problem.
Recenty I setuped logrotate twice per day: at 5am and 5pm.

Here is an apache logrotate config:
PHP Code:
/home/www/www1/logs/access_log {
    
size 100M
    nocompress
    rotate 2
    postrotate
        
/bin/kill -HUP `cat /usr/local/apache/logs/httpd.pid 2>/dev/null2> /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:
PHP Code:
/usr/local/apache/bin/apachectl stop
/usr/local/apache/bin/apachectl stophttpd stopped

/usr/local/apache/bin/apachectl start
/usr/local/apache/bin/apachectl starthttpd (pid 991already 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!

 

 

 

 

Top