14 messages in ru.sysoev.nginxRe: dynamic logs
FromSent OnAttachments
Vladan PopovicSep 11, 2008 1:15 pm 
Igor SysoevSep 11, 2008 1:36 pm 
Vladan PopovicSep 11, 2008 3:51 pm 
Igor SysoevSep 11, 2008 10:53 pm 
Vladan PopovicSep 12, 2008 12:38 am 
Igor SysoevSep 12, 2008 12:56 am 
Vladan PopovicSep 12, 2008 4:09 am 
Maxim DouninSep 12, 2008 4:40 am 
Maxim DouninSep 12, 2008 5:19 am 
Igor SysoevSep 12, 2008 5:27 am.log
Vladan PopovicSep 12, 2008 6:06 am 
Igor SysoevSep 12, 2008 6:29 am 
Igor SysoevSep 12, 2008 6:35 am 
Vladan PopovicSep 12, 2008 2:29 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: dynamic logsActions...
From:Maxim Dounin (mdou@mdounin.ru)
Date:Sep 12, 2008 4:40:40 am
List:ru.sysoev.nginx

Hello!

On Fri, Sep 12, 2008 at 11:10:02AM +0000, Vladan Popovic wrote:

Igor Sysoev <is@...> writes:

On Fri, Sep 12, 2008 at 07:38:42AM +0000, Vladan Popovic wrote:

Sorry for not being more knowledgeable ... I have init.d/nginx script to manage nginx. Should i run strace /etc/init.d/nginx restart or should i run another instruction? (i did 'strace /etc/init.d/nginx' but couldn't find the string you are looking for)

Try the following:

1) stop nginx via "/etc/init.d/nginx stop"

2) add temporarily in nginx.conf:

daemon off; master_process off;

This will force nginx to run single process only.

3) then run nginx directly under strace:

strace /usr/sbin/nginx

4) and make request.

OK - i think i managed to do it ... here's the extract:

open("/var/log/nginx/be-o.com", O_RDWR|O_CREAT|O_APPEND, 0644) = 14 fstat(14, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 fcntl(14, F_GETFL) = 0x8402 (flags O_RDWR|O_APPEND|O_LARGEFILE) fcntl(14, F_SETFL, O_RDWR|O_APPEND|O_DIRECT|O_LARGEFILE) = 0 write(14, "192.168.1.16 - - [12/Sep/2008:19"..., 196) = -1 EINVAL (Invalid argument)

Could you please check if 'directio off;' helps? It should.

Also the following patch should help without switching off directio:

--- a/src/core/ngx_open_file_cache.c +++ b/src/core/ngx_open_file_cache.c @@ -498,7 +498,7 @@ ngx_open_and_stat_file(u_char *name, ngx } else { of->fd = fd;

- if (of->directio <= ngx_file_size(&fi)) { + if (!of->log && of->directio <= ngx_file_size(&fi)) { if (ngx_directio(fd) == -1) { ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, ngx_directio_n " \"%s\" failed", name);