Welcome! Log In Create A New Profile

Advanced

Re: Workaround of race condition between systemd and nginx.

Gena Makhomed
December 31, 2015 12:06AM
On 30.12.2015 22:40, Daniel K. wrote:

>> nginx failed to start if network is down via systemd race condition.

> Again, no, nginx failed to start due to a local misconfiguration.

Configuration is correct.

"nginx -t" syntax check say:

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok

>>> listen 172.22.22.202:80;

>> this is allowed syntax:
>> http://nginx.org/en/docs/http/ngx_http_core_module.html#listen

> I never said it wasn't.

You say about "misconfiguration".

>>> And that, due to using systemd, the nginx service gets started before
>>> the network-interface have been configured with the IP address shown.
>>
>> Yes. And nginx failed to start with *correct* config.
>
> Well, syntactically correct, and logically correct is not the same thing.

My config is syntactically correct *and* it is logically correct too.

> Your config makes nginx try to bind to a non-assigned IP address,
> which fails. A logical error in your config files.

No. A logical error in nginx unit file
or in systemd source code or in nginx source code.

Result of error is race condition between systemd and nginx.
The simplest workaround of race condition is to fix nginx unit file.

>> And I should send this text fragment to all nginx users?
>
> I don't know what you should do, I feel like I am still missing a part
> of the puzzle.

Yes.

OpenVZ used by hosting providers on multiple hardware nodes.

Not always possible use only "listen 80;" and "listen 443;" directives.

> Arguably not better. The link you provided (repeated for context) tells
> you this on using network-online.target.
>
> http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/
>
> It is strongly recommended not to pull in this target too liberally:
> [...] network server software should generally not pull this in

"should generally not pull this in".

Workaround is not "generally".

> There you have it; the systemd folks tell us that your suggested
> workaround is not a good idea to use for server software.

Systemd folks tell me and other nginx developers how *exactly* nginx
should work. You have time and money to rewrite core parts of nginx?

--
Best regards,
Gena

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

Workaround of race condition between systemd and nginx.

Gena Makhomed 580 December 30, 2015 08:46AM

Re: Workaround of race condition between systemd and nginx.

Jim Popovitch 216 December 30, 2015 09:52AM

Re: Workaround of race condition between systemd and nginx.

Gena Makhomed 443 December 30, 2015 10:52AM

Re: Workaround of race condition between systemd and nginx.

Jim Popovitch 227 December 30, 2015 11:10AM

Re: Workaround of race condition between systemd and nginx.

Gena Makhomed 213 December 30, 2015 11:52AM

Re: Workaround of race condition between systemd and nginx.

Jim Popovitch 288 December 30, 2015 12:10PM

Re: Workaround of race condition between systemd and nginx.

Gena Makhomed 272 December 30, 2015 12:46PM

Re: Workaround of race condition between systemd and nginx.

Jim Popovitch 278 December 30, 2015 01:00PM

Re: Workaround of race condition between systemd and nginx.

Gena Makhomed 203 December 30, 2015 01:48PM

Re: Workaround of race condition between systemd and nginx.

Daniel K. 218 December 30, 2015 01:30PM

Re: Workaround of race condition between systemd and nginx.

Das, Jagannath 244 December 30, 2015 01:50PM

Re: Workaround of race condition between systemd and nginx.

Gena Makhomed 243 December 30, 2015 02:04PM

Re: Workaround of race condition between systemd and nginx.

Gena Makhomed 227 December 30, 2015 01:56PM

Re: Workaround of race condition between systemd and nginx.

Daniel K. 267 December 30, 2015 03:42PM

Re: Workaround of race condition between systemd and nginx.

Artem S. Povaluhin 206 December 30, 2015 05:46PM

Re: Workaround of race condition between systemd and nginx.

Gena Makhomed 272 December 31, 2015 12:06AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 154
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