ASF Bugzilla – Attachment 30791 Details for
Bug 55070
mod_fcgid stderr always goes to main error log
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
fixed a bug in the patch
use_vhost_errorlog (text/plain), 4.71 KB, created by
Jan-Oliver Kaiser
on 2013-09-01 22:19:25 UTC
(
hide
)
Description:
fixed a bug in the patch
Filename:
MIME Type:
Creator:
Jan-Oliver Kaiser
Created:
2013-09-01 22:19:25 UTC
Size:
4.71 KB
patch
obsolete
>--- a/modules/fcgid/fcgid_pm_main.c >+++ b/modules/fcgid/fcgid_pm_main.c >@@ -529,7 +529,7 @@ static void default_proc_env(apr_table_t > > static void > fastcgi_spawn(fcgid_command * command, server_rec * main_server, >- apr_pool_t * configpool) >+ server_rec * vhost, apr_pool_t * configpool) > { > fcgid_procnode *free_list_header, *proctable_array, > *procnode, *idle_list_header; >@@ -607,7 +607,7 @@ fastcgi_spawn(fcgid_command * command, s > /* XXX Spawn uses wrapper_cmdline, but log uses cgipath ? */ > if ((rv = > proc_spawn_process(command->cmdline, &procinfo, >- procnode)) != APR_SUCCESS) { >+ vhost, procnode)) != APR_SUCCESS) { > ap_log_error(APLOG_MARK, APLOG_WARNING, rv, main_server, > "mod_fcgid: spawn process %s error", command->cgipath); > >@@ -630,7 +630,8 @@ fastcgi_spawn(fcgid_command * command, s > } > } > >-apr_status_t pm_main(server_rec * main_server, apr_pool_t * configpool) >+apr_status_t pm_main(server_rec * main_server, apr_pool_t * configpool, >+ server_rec * vhost_array[]) > { > fcgid_command command; > >@@ -641,7 +642,7 @@ apr_status_t pm_main(server_rec * main_s > /* Wait for command */ > if (procmgr_peek_cmd(&command, main_server) == APR_SUCCESS) { > if (is_spawn_allowed(main_server, &command)) >- fastcgi_spawn(&command, main_server, configpool); >+ fastcgi_spawn(&command, main_server, vhost_array[command.vhost_id-1], configpool); > > procmgr_finish_notify(main_server); > } >--- a/modules/fcgid/fcgid_pm_main.h >+++ b/modules/fcgid/fcgid_pm_main.h >@@ -18,6 +18,6 @@ > #ifndef FCGID_PM_MAIN_H > #define FCGID_PM_MAIN_H > >-apr_status_t pm_main(server_rec * main_server, apr_pool_t * configpool); >+apr_status_t pm_main(server_rec * main_server, apr_pool_t * configpool, server_rec * vhost_array[]); > > #endif >--- a/modules/fcgid/fcgid_pm_unix.c >+++ b/modules/fcgid/fcgid_pm_unix.c >@@ -302,7 +302,25 @@ create_process_manager(server_rec * main > /* Initialize spawn controler */ > spawn_control_init(main_server, configpool); > >- pm_main(main_server, configpool); >+ int num_vhosts = 0; >+ server_rec* server = main_server; >+ while (server != NULL) { >+ num_vhosts++; >+ server = server->next; >+ } >+ ap_log_error(APLOG_MARK, APLOG_INFO, 0, main_server, >+ "mod_fcgid: Process manager %" APR_PID_T_FMT ": num_vhosts = %d", getpid(), num_vhosts); >+ >+ server = main_server; >+ server_rec* vhost_array[num_vhosts]; >+ vhost_array[0] = main_server; >+ int vhost_id; >+ for (vhost_id=1; vhost_id < num_vhosts; vhost_id++) { >+ server = server->next; >+ vhost_array[vhost_id] = server; >+ } >+ >+ pm_main(main_server, configpool, vhost_array); > > ap_log_error(APLOG_MARK, APLOG_INFO, 0, main_server, > "mod_fcgid: Process manager %" APR_PID_T_FMT " stopped", getpid()); >--- a/modules/fcgid/fcgid_proc_unix.c >+++ b/modules/fcgid/fcgid_proc_unix.c >@@ -192,7 +192,7 @@ static apr_status_t exec_setuid_cleanup( > } > > apr_status_t proc_spawn_process(const char *cmdline, fcgid_proc_info *procinfo, >- fcgid_procnode *procnode) >+ server_rec * vhost, fcgid_procnode *procnode) > { > server_rec *main_server = procinfo->main_server; > fcgid_server_conf *sconf = ap_get_module_config(main_server->module_config, >@@ -358,10 +358,10 @@ apr_status_t proc_spawn_process(const ch > /* Prepare the fork */ > if ((rv = apr_procattr_create(&procattr, procnode->proc_pool)) != APR_SUCCESS > || (rv = apr_procattr_child_err_set(procattr, >- procinfo->main_server->error_log, >+ vhost->error_log, > NULL)) != APR_SUCCESS > || (rv = apr_procattr_child_out_set(procattr, >- procinfo->main_server->error_log, >+ vhost->error_log, > NULL)) != APR_SUCCESS > || (rv = apr_procattr_dir_set(procattr, > ap_make_dirstr_parent(procnode->proc_pool, >--- a/modules/fcgid/fcgid_proc.h >+++ b/modules/fcgid/fcgid_proc.h >@@ -41,6 +41,7 @@ typedef struct { > > apr_status_t proc_spawn_process(const char *cmdline, > fcgid_proc_info * procinfo, >+ server_rec * vhost, > fcgid_procnode * procnode); > > apr_status_t proc_kill_gracefully(fcgid_procnode * procnode,
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 Raw
Actions:
View
Attachments on
bug 55070
:
30763
| 30791