Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 108428 Details for
Bug 164325
www-servers/lighttpd - fastcgi processes spawned from lighttpd inherit the controlling terminal for stderr
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for lighttpd 1.4.x's mod_fastcgi to link stderr for the fastcgi processes with the error log in gentoo's format
05_all_lighttpd-1.4.13-fastcgi-print-stderrlog.diff (text/plain), 2.08 KB, created by
Carlo Marcelo Arenas Belon
on 2007-01-28 22:15:55 UTC
(
hide
)
Description:
patch for lighttpd 1.4.x's mod_fastcgi to link stderr for the fastcgi processes with the error log in gentoo's format
Filename:
MIME Type:
Creator:
Carlo Marcelo Arenas Belon
Created:
2007-01-28 22:15:55 UTC
Size:
2.08 KB
patch
obsolete
>diff -urb lighttpd-1.4.13.orig/src/mod_fastcgi.c lighttpd-1.4.13/src/mod_fastcgi.c >--- lighttpd-1.4.13.orig/src/mod_fastcgi.c 2007-01-28 05:44:04.000000000 -0800 >+++ lighttpd-1.4.13/src/mod_fastcgi.c 2007-01-28 05:49:32.000000000 -0800 >@@ -906,6 +906,7 @@ > char *c; > char_array env; > char_array arg; >+ int fd; > > /* create environment */ > env.ptr = NULL; >@@ -922,6 +923,28 @@ > close(fcgi_fd); > } > >+ /* HACK: >+ * This is not nice, but it works >+ * >+ * we feed the stderr of the FastCGI to our errorlog, >+ * for messages that were written to stderr by mistake. >+ * >+ * this violates the fastcgi SPEC because stderr >+ * should be closed and all errors are meant to be >+ * sent as FCGI_STDERR packets to the webserver and >+ * not written directly to the log. >+ */ >+ >+ if ((srv->errorlog_mode == ERRORLOG_FILE) || (srv->errorlog_mode == ERRORLOG_PIPE)) { >+ close(STDERR_FILENO); >+ dup2(srv->errorlog_fd, STDERR_FILENO); >+ } else { >+ if (-1 != (fd = open("/dev/null", O_WRONLY))) { >+ close(STDERR_FILENO); >+ dup2(fd, STDERR_FILENO); >+ close(fd); >+ } >+ } > /* we don't need the client socket */ > for (i = 3; i < 256; i++) { > close(i); >diff -urb lighttpd-1.4.13.orig/src/server.c lighttpd-1.4.13/src/server.c >--- lighttpd-1.4.13.orig/src/server.c 2006-10-04 06:30:52.000000000 -0700 >+++ lighttpd-1.4.13/src/server.c 2007-01-28 05:49:32.000000000 -0800 >@@ -844,6 +844,16 @@ > pid_fd = -1; > } > >+ if (-1 == log_error_open(srv)) { >+ log_error_write(srv, __FILE__, __LINE__, "s", >+ "opening errorlog failed, dying"); >+ >+ plugins_free(srv); >+ network_close(srv); >+ server_free(srv); >+ return -1; >+ } >+ > if (HANDLER_GO_ON != plugins_call_set_defaults(srv)) { > log_error_write(srv, __FILE__, __LINE__, "s", "Configuration of plugins failed. Going down."); > >@@ -894,15 +904,6 @@ > return -1; > } > >- if (-1 == log_error_open(srv)) { >- log_error_write(srv, __FILE__, __LINE__, "s", >- "opening errorlog failed, dying"); >- >- plugins_free(srv); >- network_close(srv); >- server_free(srv); >- return -1; >- } > > > #ifdef HAVE_SIGACTION
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 164325
: 108428