ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Igor Zubkov <igor.zubkov@gmail.com>
To: ALT Linux Team development discussions <devel@lists.altlinux.org>
Subject: Re: [devel] План роста packages.altlinux.org (was: Re: sisyphus.ru)
Date: Tue, 12 Feb 2013 17:10:16 +0200
Message-ID: <CAJXf7QMdn-W_x-m6zdcKi6Zv9pEiSv0US1yH-=WeXbKzQxaTXA@mail.gmail.com> (raw)
In-Reply-To: <20130212141035.GA17893@altlinux.org>

2013/2/12 Dmitry V. Levin:
> On Tue, Feb 12, 2013 at 03:43:56PM +0200, Michael Shigorin wrote:
>> On Tue, Feb 12, 2013 at 03:32:11PM +0200, Igor Zubkov wrote:
>> > Получается что access.log ротейтнулся, но не зажался. И nginx в
>> > него всё ещё пишет. Так и место когда-то закончится. Его надо
>> > рестартовать после logrotate. Баг сейчас повешу.
>>
>> А теперь подумай, что будет с логами, если отодвинуть,
>> зажать и удалить последнее имя того файла, в который
>> через уже открытый fd ещё пишет какой-нить nginx.
>
> Собственно говоря, эта фича называется delaycompress.

Что-то я не понимаю как это должно работать. По шагам:
[root@prometheus ~]# ls -la /var/log/nginx/access.log*
-rw-r--r-- 1 prometheusapp _nginx         0 ноя 22 00:38
/var/log/nginx/access.log
-rw-r--r-- 1 prometheusapp _nginx 808817073 фев 12 17:29
/var/log/nginx/access.log.1
-rw-r--r-- 1 prometheusapp _nginx   2762937 ноя 21 01:11
/var/log/nginx/access.log.2.bz2
-rw-r--r-- 1 prometheusapp _nginx   6315243 ноя 16 19:37
/var/log/nginx/access.log.3.bz2
-rw-r--r-- 1 prometheusapp _nginx  12019308 ноя  6 19:19
/var/log/nginx/access.log.4.bz2
[root@prometheus ~]#

Есть новый access.log который сейчас пустой. Есть старый access.log.1.
И есть более старый access.log.2 который от 21 ноября уже прошлого
года.

Есть:
[root@prometheus ~]# cat /etc/cron.daily/logrotate
#!/bin/sh
exec /usr/sbin/logrotate /etc/logrotate.conf
[root@prometheus ~]# service crond status
crond is running
[root@prometheus ~]#

Т.е. есть /etc/cron.daily/logrotate и запущенный сервис crond.

[root@prometheus ~]# cat /etc/logrotate.d/nginx
/var/log/nginx/*log {
    missingok
    notifempty
    sharedscripts
    delaycompress
    create 0644 root _nginx
    postrotate
        /sbin/service nginx rotate >/dev/null
    endscript
}
[root@prometheus ~]#

Хорошо, тут есть delaycompress. И вызов service nginx rotate. В
/etc/init.d/nginx:
        rotate)
                msg_reloading nginx
                stop_daemon --pidfile "$PIDFILE" --expect-user root
-USR1 -- nginx

Согласно документации, USR1 должен заставить сделать "Reopen the log files".

[root@prometheus ~]# cat /var/log/syslog/messages | grep cron.daily
Feb 11 00:38:01 prometheus crond[32444]: (root) CMD (run-parts /etc/cron.daily)
Feb 12 00:38:01 prometheus crond[28609]: (root) CMD (run-parts /etc/cron.daily)
[root@prometheus ~]#

Согласно логам crond, он запустил /etc/cron.daily.

[root@prometheus ~]# /etc/init.d/nginx rotate
Reloading nginx service: [ DONE ]
[root@prometheus ~]#

И ничего не происходит. Делаем в упор:

[root@prometheus ~]# kill -s USR1 `cat /var/run/nginx.pid`
[root@prometheus ~]#

Тоже не работает. На лицо баг в nginx. Повесил в upsteam:
http://trac.nginx.org/nginx/ticket/297

-- 
Igor Zubkov
http://hi.im/ice

  reply	other threads:[~2013-02-12 15:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-12 13:32 Igor Zubkov
2013-02-12 13:43 ` Michael Shigorin
2013-02-12 14:10   ` Dmitry V. Levin
2013-02-12 15:10     ` Igor Zubkov [this message]
2013-02-12 14:11   ` Sergey Y. Afonin
2013-02-12 13:57 ` Андрей Черепанов
2013-02-12 20:46 ` [devel] План роста packages.altlinux.org Michael Shigorin
2013-03-10  9:01 ` [devel] План роста packages.altlinux.org (was: Re: sisyphus.ru) Sergey Afonin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJXf7QMdn-W_x-m6zdcKi6Zv9pEiSv0US1yH-=WeXbKzQxaTXA@mail.gmail.com' \
    --to=igor.zubkov@gmail.com \
    --cc=devel@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git