Default log file locations

Sergey Brester serg.brester at sebres.de
Thu Jun 27 18:46:24 UTC 2019


 

Hmm... 

>From _The Linux Programming Interface: A Linux and UNIX System
Programming Handbook_ [2]: 

Nonblocking mode can be used with devices (e.g., terminals and
pseudoterminals), pipes, FIFOs, and sockets. (Because file descriptors
for pipes and sockets are not obtained using open(), we must enable this
flag using the fcntl() F_SETFL operation described in Section 5.3.) 

So basically if a "sharing" of standard handles is properly implemented
between master/workers and a line buffering is good enough for the
logging, you can "write to terminal in non-blocking manner." 

Additionally note the stdout can be mapped to systemd journals (which
are files and channel will be to pipe), if nginx would running as
systemd service unit.

Regards,
Serg. 

27.06.2019 19:35, Valentin V. Bartenev wrote: 

> Afaik, there's no way in Linux systems to write to terminal in
> non-blocking manner. As the result, writing log can block the
> whole nginx worker process and cause DoS.
> 
> IMHO, it's not a good idea to make your web-application depend
> on logging capabilities.
> 
> wbr, Valentin V. Bartenev
> 
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.orghttp://mailman.nginx.org/mailman/listinfo/nginx-devel [1]
 

Links:
------
[1] http://mailman.nginx.org/mailman/listinfo/nginx-devel
[2]
https://books.google.de/books?id=Ps2SH727eCIC&lpg=PA103&ots=kMHcB5EQya&dq=From%20The%20Linux%20Programming%20Interface%3A%20A%20Linux%20and%20UNIX%20System%20Programming%20Handbook%3A%20Nonblocking%20mode%20can%20be%20used%20with%20devices%20(e.g.%2C%20terminals%20and%20pseudoterminals)%2C%20pipes%2C%20FIFOs%2C%20and%20sockets.%20(Because%20file%20descriptors%20for%20pipes%20and%20sockets%20are%20not%20obtained%20using%20open()%2C%20we%20must%20enable%20The%20Linux%20Programming%20Interface%3A%20A%20Linux%20and%20UNIX%20System%20Programming%20Handbook&hl=de&pg=PA103#v=onepage&q&f=false
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20190627/79f51489/attachment.html>


More information about the nginx-devel mailing list