Forum: NGINX upcoming 0.7.53 large patch

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-04-23 21:28
(Received via mailing list)
Future even today:
http://sysoev.ru/tmp/patch.0.7.52.prefix

There are many changes related to the "-p prefix" switch support
and the start up error logging and I want to test them before release.

    *) Change: now a log set by --error-log-path is created from the
very
       start up.

    *) Feature: now the start up errors and warnings are outputted to an
       error_log and stderr.

    *) Feature: the --prefix=. configure parameter forces nginx to use
       current directory as prefix.

    *) Feature: the -p switch.

    *) Feature: the -s switch on Unix platforms.

    *) Feature: the -? and -h switches.

    *) Feature: now switches may be set in condensed form.

    *) Bugfix: the "fastcgi_cache_min_uses" directive did not work.
Fcaa940f447c1c76afb8ee2448ba0461?d=identicon&s=25 Jérôme Loyet (Guest)
on 2009-04-23 23:39
(Received via mailing list)
Hi igor,

in order to compile the patch version, I had to modify the patch
because it tried to patch auto/configure. The configure is in the root
directory, not in auto. Or I misunderstood something ?

Then I didn't understand how the -p option works. I made the following
test:
./configure
/usr/local/nginx/sbin/nginx -p /root/test/nginx

but all file are relative to the default prefix (/usr/local/nginx)
except the root directive which is relative to /root/test/nginx in my
case.

Thx for the answers
++ jerome

2009/4/23 Igor Sysoev <is@rambler-co.ru>:
Fcaa940f447c1c76afb8ee2448ba0461?d=identicon&s=25 Jérôme Loyet (Guest)
on 2009-04-24 00:36
(Received via mailing list)
> but all file are relative to the default prefix (/usr/local/nginx)
> except the root directive which is relative to /root/test/nginx in my
> case.

I don't know what I did but this behaviour is not the one I described
earlier.

The test is the following!
.#/configure
#make && make install
# /usr/local/nginx/sbin/nginx -V
nginx version: nginx/0.7.52
configure arguments:

# (cd /tmp && /usr/local/nginx/sbin/nginx)
[emerg]: could not open error log file: open() "logs/error.log" failed
(2: )

# (cd /path/where/logs/directory/exists && /usr/local/nginx/sbin/nginx)
[emerg]: open() "conf/conf/nginx.conf" failed (2: )

# (cd /tmp && strace -e open /usr/local/nginx/sbin/nginx -p
/root/test/nginx/)
[emerg]: could not open error log file: open() "logs/error.log" failed
(2: )

It seems there is a bug with the default error_log and/or the prefix.

++ Jerome
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-04-24 08:36
(Received via mailing list)
On Fri, Apr 24, 2009 at 12:25:09AM +0200, J?r?me Loyet wrote:

> > but all file are relative to the default prefix (/usr/local/nginx)
> configure arguments:
> It seems there is a bug with the default error_log and/or the prefix.
A new version, that fixes startup error log prefix:

http://sysoev.ru/tmp/patch.0.7.52.1.prefix

BTW, what OS do you use ? Recently I saw messages without text
description of error: "open() "logs/error.log" failed (2: )".
while it should be "(2: No such file or directory)".
Fcaa940f447c1c76afb8ee2448ba0461?d=identicon&s=25 Jérôme Loyet (Guest)
on 2009-04-24 08:44
(Received via mailing list)
2009/4/24 Igor Sysoev <is@rambler-co.ru>:
>> > /usr/local/nginx/sbin/nginx -p /root/test/nginx
>> # /usr/local/nginx/sbin/nginx -V
>> [emerg]: could not open error log file: open() "logs/error.log" failed (2: )
>>
>> It seems there is a bug with the default error_log and/or the prefix.
>
> A new version, that fixes startup error log prefix:
>
> http://sysoev.ru/tmp/patch.0.7.52.1.prefix
>
> BTW, what OS do you use ? Recently I saw messages without text
> description of error: "open() "logs/error.log" failed (2: )".
> while it should be "(2: No such file or directory)".

I'm using linux ubuntu 8.04.
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-04-24 09:52
(Received via mailing list)
On Fri, Apr 24, 2009 at 08:35:58AM +0200, J?r?me Loyet wrote:

> > description of error: "open() "logs/error.log" failed (2: )".
> > while it should be "(2: No such file or directory)".
>
> I'm using linux ubuntu 8.04.

What does "./configure | grep strerror" show ?
Fcaa940f447c1c76afb8ee2448ba0461?d=identicon&s=25 Jérôme Loyet (Guest)
on 2009-04-24 09:56
(Received via mailing list)
2009/4/24 Igor Sysoev <is@rambler-co.ru>:
>> >
>> > BTW, what OS do you use ? Recently I saw messages without text
>> > description of error: "open() "logs/error.log" failed (2: )".
>> > while it should be "(2: No such file or directory)".
>>
>> I'm using linux ubuntu 8.04.
>
> What does "./configure | grep strerror" show ?

root@wild:~/nginx-0.7.52# ./configure | grep strerror
checking for strerror_r() ... found
checking for gnu style strerror_r() ... found but is not working
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-04-24 11:10
(Received via mailing list)
Attachment: patch.gnu_strerror_r (321 Bytes)
On Fri, Apr 24, 2009 at 09:48:52AM +0200, J?r?me Loyet wrote:

> >> > http://sysoev.ru/tmp/patch.0.7.52.1.prefix
> checking for strerror_r() ... found
> checking for gnu style strerror_r() ... found but is not working

Could you test the attached patch ? It seems it was broken in 0.7.45.
Fcaa940f447c1c76afb8ee2448ba0461?d=identicon&s=25 Jérôme Loyet (Guest)
on 2009-04-24 11:18
(Received via mailing list)
2009/4/24 Igor Sysoev <is@rambler-co.ru>:
>> >> > A new version, that fixes startup error log prefix:
>>
>> root@wild:~/nginx-0.7.52# ./configure | grep strerror
>> checking for strerror_r() ... found
>> checking for gnu style strerror_r() ... found but is not working
>
> Could you test the attached patch ? It seems it was broken in 0.7.45.

This patch correct the bug for str_error_r.
Fcaa940f447c1c76afb8ee2448ba0461?d=identicon&s=25 Jérôme Loyet (Guest)
on 2009-04-24 14:50
(Received via mailing list)
2009/4/24 Igor Sysoev <is@rambler-co.ru>:
>> > /usr/local/nginx/sbin/nginx -p /root/test/nginx
>> # /usr/local/nginx/sbin/nginx -V
>> [emerg]: could not open error log file: open() "logs/error.log" failed (2: )
>>
>> It seems there is a bug with the default error_log and/or the prefix.
>
> A new version, that fixes startup error log prefix:
>
> http://sysoev.ru/tmp/patch.0.7.52.1.prefix
>

here the test I made:
#tar -xzvf nginx-0.7.52.tar.gz
# cd nginx-0.7.52
# patch -p0 < ../patch.0.7.52.1.prefix
# patch -p0 < ../patch.gnu_strerror_r
#./configure
#make && make install
# (cd /tmp && /usr/local/nginx/sbin/nginx)
[emerg]: could not open error log file: open() "/logs/error.log"
failed (2: No such file or directory)

it should be /usr/local/nginx/logs/error.log

# (cd /tmp && /usr/local/nginx/sbin/nginx -p /root/test/nginx)
2009/04/24 14:38:57 [notice] 27082#0: using the "epoll" event method
2009/04/24 14:38:57 [notice] 27082#0: nginx/0.7.52
2009/04/24 14:38:57 [notice] 27082#0: OS: Linux
2.6.25.4dedibox-r9-smp-x32
2009/04/24 14:38:57 [notice] 27082#0: getrlimit(RLIMIT_NOFILE):
1024:1024
2009/04/24 14:38:57 [notice] 27083#0: start worker processes
2009/04/24 14:38:57 [notice] 27083#0: start worker process 27084
root@wild:~/nginx-0.7.52# 2009/04/24 14:39:04 [error] 27084#0: *1
open() "/root/test/nginx/docs/sdfsdfsdfs" failed (2: No such file or
directory), client: 160.92.7.69, server: localhost, request: "GET
/sdfsdfsdfs HTTP/1.0", host: "wild.xxxxxxxx.com"

The file /root/test/nginx/logs/error.log is created but stays empty.
And for information it's owned by user root.

Hope this help
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-04-24 17:16
(Received via mailing list)
On Fri, Apr 24, 2009 at 02:43:43PM +0200, J?r?me Loyet wrote:

>
> open() "/root/test/nginx/docs/sdfsdfsdfs" failed (2: No such file or
> directory), client: 160.92.7.69, server: localhost, request: "GET
> /sdfsdfsdfs HTTP/1.0", host: "wild.xxxxxxxx.com"
>
> The file /root/test/nginx/logs/error.log is created but stays empty.
> And for information it's owned by user root.
>
> Hope this help

http://sysoev.ru/tmp/patch.0.7.52.2.prefix
Fcaa940f447c1c76afb8ee2448ba0461?d=identicon&s=25 Jérôme Loyet (Guest)
on 2009-04-24 18:06
(Received via mailing list)
2009/4/24 Igor Sysoev <is@rambler-co.ru>:
>> [emerg]: could not open error log file: open() "/logs/error.log"
>> 2009/04/24 14:38:57 [notice] 27083#0: start worker process 27084
> http://sysoev.ru/tmp/patch.0.7.52.2.prefix
Still the same problem:

root@wild:~/nginx-0.7.52# (cd /tmp && /usr/local/nginx/sbin/nginx)
[emerg]: could not open error log file: open() "/logs/error.log"
failed (2: No such file or directory)

Why does NGX_PREFIX is set to / ?
#ifndef NGX_PREFIX
#define NGX_PREFIX  "/"
#endif
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-04-24 18:12
(Received via mailing list)
On Fri, Apr 24, 2009 at 05:58:43PM +0200, J?r?me Loyet wrote:

> #define NGX_PREFIX  "/"
> #endif

Could you show ./configure options ?
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-04-24 18:31
(Received via mailing list)
On Fri, Apr 24, 2009 at 05:58:43PM +0200, J?r?me Loyet wrote:

> >> # (cd /tmp && /usr/local/nginx/sbin/nginx)
> >> 2009/04/24 14:38:57 [notice] 27083#0: start worker processes
> >
> #define NGX_PREFIX  "/"
> #endif

It seems you used ./configure --prefix= ?
Fcaa940f447c1c76afb8ee2448ba0461?d=identicon&s=25 Jérôme Loyet (Guest)
on 2009-04-24 18:51
(Received via mailing list)
no options:

./configure
make
make install

2009/4/24 Igor Sysoev <is@rambler-co.ru>:
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-04-24 19:20
(Received via mailing list)
On Fri, Apr 24, 2009 at 06:43:25PM +0200, J?r?me Loyet wrote:

> >>
> >
> > Could you show ./configure options ?

This patch fixes the bug:
http://sysoev.ru/tmp/patch.0.7.52.3.prefix

Now

./configure               # prefix is /usr/local/nginx

./configure --prefix=     # no prefix at all, "make install" has no
sense
                          # nginx will use directory where it was run as
prefix

./configure --prefix=XXXX # prefix is XXXX
Fcaa940f447c1c76afb8ee2448ba0461?d=identicon&s=25 Jérôme Loyet (Guest)
on 2009-04-24 22:14
(Received via mailing list)
2009/4/24 Igor Sysoev <is@rambler-co.ru>:
>> >
>> >> #define NGX_PREFIX  "/"
>
> ./configure --prefix=     # no prefix at all, "make install" has no sense
>                          # nginx will use directory where it was run as prefix
>
> ./configure --prefix=XXXX # prefix is XXXX
>

it seems to be much better. I'll make some tests later.

++ Jerome
This topic is locked and can not be replied to.