01.08.2013 03:07, Sergey Kobzar пишет:
Linux 3.8.13-gentoo x86_64
nginx-1.4.1-r2
logrotate-3.8.4

cat /etc/logrotate.d/nginx:
/var/log/nginx/*.log {
        daily
        rotate 5
        missingok
        nocompress
        sharedscripts
        postrotate
                test -r /run/nginx.pid && kill -USR1 `cat /run/nginx.pid`
        endscript
}

/etc/logrotate.conf:
weekly
rotate 4
create
dateext
compress
notifempty
nomail
noolddir
include /etc/logrotate.d
/var/log/wtmp {
    monthly
    create 0664 root utmp
        minsize 1M
    rotate 1
}
/var/log/btmp {
    missingok
    monthly
    create 0600 root utmp
    rotate 1
}

# ls -alh /var/log/nginx/ | grep access.log
-rw-r--r--  1 nginx root    0 Jul 30 03:10 access.log
-rw-r--r--  1 nginx root 4.7G Jul 18 10:09 access.log-20130712
-rw-r--r--  1 nginx root 7.6G Jul 29 09:46 access.log-20130719
-rw-r--r--  1 nginx root 1.4G Jul 31 22:04 access.log-20130730

Т.е. запись в access.log не идет, а растет access.log-20130730.

kill -USR1 `cat /run/nginx.pid` ситуацию не меняет.

Что я не так?

Спасибо.

_______________________________________________
nginx-ru mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx-ru
У меня (RHEL 6) в качестве postrotate-команды используется эта:
/etc/init.d/nginx reload > /dev/null 2>/dev/null || true
в скрипте /etc/init.d/nginx в функции отвечающей за reload используется
killproc $nginx -HUP

Попробуйте сменить -USR1 в вашей команде на -HUP?
Вот так это выглядит целиком:
/var/log/nginx/*log {
missingok
compress
notifempty
sharedscripts
postrotate
    /sbin/service nginx reload > /dev/null 2>/dev/null || true
endscript
}

_______________________________________________
nginx-ru mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Ответить