Welcome! Log In Create A New Profile

Advanced

Re: Nginx and logrotate

August 08, 2013 04:38AM
On 08/08/13 10:43, Boris Talovikov wrote:

>>>> 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
>>>> }
>>>
>>> У вас PID файлы точно в /run ? Обычно это /var/run
>>
>> Угу:
>>
>> # la /var/run
>> lrwxrwxrwx 1 root root 4 Jan 23 2013 /var/run -> /run
>>
>> # ps ax | grep nginx
>> 1965 ? Ss 0:00 nginx: master process /usr/sbin/nginx -c
>> /etc/nginx/nginx.conf
>> 1966 ? S 35:55 nginx: worker process
>> 1967 ? S 35:37 nginx: worker process
>> 1969 ? S 35:08 nginx: worker process
>> 1970 ? S 34:57 nginx: worker process
>> 1971 ? S 34:55 nginx: worker process
>> 1972 ? S 35:12 nginx: worker process
>> 1973 ? S 35:11 nginx: worker process
>> 1974 ? S 36:01 nginx: worker process
>>
>> # cat /run/nginx.pid
>> 1965
>>
>>
>>>> Сегодня утром получил сообщение от cron'а:
>>>> gzip: stdin: file size changed while zipping
>>>> gzip: stdin: file size changed while zipping
>>>>
>>>> Но так, как в /etc/logrotate.d/nginx есть nocompress, то есть
>>>> подозрение, что это общесистемное.
>>>>
>>>> Any ideas?
>>
>> _______________________________________________
>> nginx-ru mailing list
>> nginx-ru@nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx-ru
>
> Здравствуйте, а можно увидеть вывод команды
>
> logrotate -d /etc/logrotate.conf ?

Ну вот сегодня отротировалось все нормально:
-rw-r--r-- 1 nginx root 268M Aug 8 11:32 access.log
-rw-r--r-- 1 nginx root 1.2G Aug 3 03:10 access.log-20130803
-rw-r--r-- 1 nginx root 1.1G Aug 4 03:10 access.log-20130804
-rw-r--r-- 1 nginx root 2.5G Aug 6 03:10 access.log-20130805
-rw-r--r-- 1 nginx root 2.5G Aug 8 01:31 access.log-20130807
-rw-r--r-- 1 nginx root 20M Aug 8 03:10 access.log-20130808

# logrotate -d /etc/logrotate.conf
reading config file /etc/logrotate.conf
including /etc/logrotate.d
reading config file elog-save-summary
reading config file exim
reading config file munin
reading config file mysql
reading config file nginx
reading config file openrc
reading config file php-fpm
reading config file rsyncd
reading config file sphinx
reading config file syslog-ng

Handling 15 logs

...

rotating pattern: /var/log/nginx/*.log after 1 days (5 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/nginx/default-ssl_access.log
log does not need rotating
considering log /var/log/nginx/default-ssl_error.log
log does not need rotating
considering log /var/log/nginx/access.log
log does not need rotating
considering log /var/log/nginx/error.log
log does not need rotating

Ротацию логов для других сервисов поскипал.

_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

Nginx and logrotate

sergey.kobzar July 31, 2013 05:08PM

Re: Nginx and logrotate

Валентин Бартенев July 31, 2013 06:16PM

Re: Nginx and logrotate

sergey.kobzar August 01, 2013 03:28AM

Re: Nginx and logrotate

Maxim Dounin August 01, 2013 05:22AM

Re: Nginx and logrotate

sergey.kobzar August 01, 2013 05:24AM

Re: Nginx and logrotate

sergey.kobzar August 07, 2013 01:08PM

Re: Nginx and logrotate

Вячеслав Кокорин August 07, 2013 01:58PM

Re: Nginx and logrotate

sergey.kobzar August 07, 2013 02:16PM

Re: Nginx and logrotate

Boris Talovikov August 08, 2013 03:46AM

Re: Nginx and logrotate

sergey.kobzar August 08, 2013 04:38AM

Re: Nginx and logrotate

sergey.kobzar August 09, 2013 05:14AM

Re: Nginx and logrotate

Валентин Бартенев August 09, 2013 05:50AM

Re: Nginx and logrotate

sergey.kobzar August 09, 2013 06:04AM

Re: Nginx and logrotate

Raven_kg July 31, 2013 10:42PM

Re: Nginx and logrotate

sergey.kobzar August 01, 2013 03:36AM

Re: Nginx and logrotate

Anonymous User August 01, 2013 04:22AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 319
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready