dynamic logs

Vladan Popovic vladanpopovic at be-o.com
Fri Sep 12 15:10:02 MSD 2008


Igor Sysoev <is at ...> 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)
close(14)                               = 0
close(13)                               = 0
setsockopt(12, SOL_TCP, TCP_NODELAY, [1], 4) = 0
recvfrom(12, 0x6a3620, 1024, 0, 0, 0)   = -1 EAGAIN (Resource temporarily
unavailable)
epoll_wait(7, {{EPOLLIN, {u32=7148785, u64=7148785}}}, 512, 28931) = 1
recvfrom(9, "GET /img/bottom_right.gif HTTP/1"..., 1024, 0, NULL, NULL) = 457
open("/home/http/sites/be-o.com/www/htdocs/img/bottom_right.gif", O_RDONLY) = 13
fstat(13, {st_mode=S_IFREG|0644, st_size=168, ...}) = 0
writev(9, [{"HTTP/1.1 304 Not Modified\r\nServe"..., 158}], 1) = 158
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"..., 205) = -1 EINVAL (Invalid 
argument)
close(14)                               = 0
close(13)                               = 0
recvfrom(9, 0x6a2ee0, 1024, 0, 0, 0)    = -1 EAGAIN (Resource temporarily
unavailable)
epoll_wait(7, {{EPOLLIN|EPOLLOUT, {u32=7148624, u64=7148624}}}, 512, 28561) = 1
recvfrom(8, "GET /default.css HTTP/1.1\r\nHost:"..., 1024, 0, NULL, NULL) = 433
open("/home/http/sites/be-o.com/www/htdocs/default.css", O_RDONLY) = 13
fstat(13, {st_mode=S_IFREG|0644, st_size=1881, ...}) = 0
writev(8, [{"HTTP/1.1 304 Not Modified\r\nServe"..., 158}], 1) = 158
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)








More information about the nginx mailing list