No objections from me, as I lack the expertise here. Patch looks readable, though. ;)
> Am 05.07.2019 um 12:57 schrieb Joe Orton <jor...@redhat.com>: > > PR 54211 and 60692 track a design problem in mod_cgid: the stderr of > spawned CGI scripts is a copy of the main server's stderr. This is a > significant regression from mod_cgi (you lose logging prefixes, > per-vhost config, non-file/pipe-logging provider support e.g. syslog) > > I can think of two main approaches to fix this: > > 1) enhance the client/server protocol which cgid uses to be a bit more > like FastCGI with headers, record types, etc and multiplex both stderr > and stdout over the Unix socket. We'd need a new thread or process for > each new spawned script child to translate CGI stdout/stderr into this > protocol, or to completely redesign the cgid_server main loop to be > event-driven. Plus a new bucket type similar to the CGI bucket which > handles the protocol client side. > > 2) Create a new pipe for stderr in the client and pass this to the > server using Unix fd passing magic for the CGI script to use as stderr. > Factor out the CGI bucket from mod_cgi and use this as-is in mod_cgid. > > I think (1) might be a cleaner design in the long run but (2) is going > to be vastly simpler to implement. (2) might take some effort from > platform maintainers to work across all Unixes. > > I'm going to run with (2) in two steps unless there are major > objections. > > a) make fd passing work (opt-in via configure switch) if ErrorLog is an > fd, by passing that fd directly to the server (fixing PR 60692 only) - > PoC attached to show this is relatively simple, +100 lines > > b) then make that work via a new pipe with the CGI bucket abstracted out > and used across both mod_cgi/cgid (properly fixing PR 54211) > > Regards, Joe > > <ap_cgid_fdpass.patch>