[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Apache2's logrotate script



В Вто, 17/06/2008 в 09:09 +0200, Alex Mestiashvili пишет:
> Покотиленко Костик wrote:
> > На одном серваке задрала вот такая хрень (cron отписывается):
> >
> > /etc/cron.daily/logrotate:
> > (98)Address already in use: make_sock: could not bind to address [::]:80
> > (98)Address already in use: make_sock: could not bind to address
> > 0.0.0.0:80
> > no listening sockets available, shutting down
> > Unable to open logs
> > error: error running shared postrotate script
> > for /var/log/apache2/*.log 
> > error: error running prerotate script for /var/log/atop.log, leaving old
> > log in place
> > run-parts: /etc/cron.daily/logrotate exited with return code 1
> >
> > В вследствие чего естественно апача сдыхает. Происходит это не каждый
> > раз, обновления последние, Etch.
> >
> > Судя по всему apache2 просто долго завершается, logrotate не дожидаясь
> > полного завершения ротейтит логи и пытается запустить её опять, а порт
> > ещё занят, запуск не получается, спустя какое-то время старый апач
> > завершается и система остаётся без веб-сервера!
> >
> > Не подскажете ли куда капнуть?
> >
> >   
> Я тут погуглил немного ,
> http://www.mail-archive.com/debian-apache@lists.debian.org/msg08771.html
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=301702
> 
> похоже на баг , причем древний .

Причем, он помечен как решённый. Перепроверил ещё раз, и, похоже, я
напортачил в конфиге logrotate, в /etc/logrotate.d/apache2 было так:

/var/log/apache2/*.log {
        weekly
        missingok
        rotate 52
        compress
        delaycompress
        notifempty
        create 640 root adm
        sharedscripts
        postrotate
                if [ -f /var/run/apache2.pid ]; then
                        /etc/init.d/apache2 restart > /dev/null
                fi
        endscript
}

/var/www/*/log/*.log {
       weekly
       missingok
       rotate 52
       compress
       delaycompress
       notifempty
       create 640 root adm
       sharedscripts
       postrotate
               if [ -f /var/run/apache2.pid ]; then
                       /etc/init.d/apache2 restart > /dev/null
               fi
       endscript
}

Исправил на:

/var/log/apache2/*.log /var/www/*/log/*.log {
        weekly
        missingok
        rotate 52
        compress
        delaycompress
        notifempty
        create 640 root adm
        sharedscripts
        postrotate
                if [ -f /var/run/apache2.pid ]; then
                        /etc/init.d/apache2 restart > /dev/null
                fi
        endscript
}

В воскресенье посмотрим.

-- 
Покотиленко Костик <casper@meteor.dp.ua>


Reply to: