Line
Link Here
|
0 |
-- a/modules/fcgid/fcgid_pm_main.c |
0 |
++ b/modules/fcgid/fcgid_pm_main.c |
Lines 529-535
static void default_proc_env(apr_table_t
Link Here
|
529 |
|
529 |
|
530 |
static void |
530 |
static void |
531 |
fastcgi_spawn(fcgid_command * command, server_rec * main_server, |
531 |
fastcgi_spawn(fcgid_command * command, server_rec * main_server, |
532 |
apr_pool_t * configpool) |
532 |
server_rec * vhost, apr_pool_t * configpool) |
533 |
{ |
533 |
{ |
534 |
fcgid_procnode *free_list_header, *proctable_array, |
534 |
fcgid_procnode *free_list_header, *proctable_array, |
535 |
*procnode, *idle_list_header; |
535 |
*procnode, *idle_list_header; |
Lines 607-613
fastcgi_spawn(fcgid_command * command, s
Link Here
|
607 |
/* XXX Spawn uses wrapper_cmdline, but log uses cgipath ? */ |
607 |
/* XXX Spawn uses wrapper_cmdline, but log uses cgipath ? */ |
608 |
if ((rv = |
608 |
if ((rv = |
609 |
proc_spawn_process(command->cmdline, &procinfo, |
609 |
proc_spawn_process(command->cmdline, &procinfo, |
610 |
procnode)) != APR_SUCCESS) { |
610 |
vhost, procnode)) != APR_SUCCESS) { |
611 |
ap_log_error(APLOG_MARK, APLOG_WARNING, rv, main_server, |
611 |
ap_log_error(APLOG_MARK, APLOG_WARNING, rv, main_server, |
612 |
"mod_fcgid: spawn process %s error", command->cgipath); |
612 |
"mod_fcgid: spawn process %s error", command->cgipath); |
613 |
|
613 |
|
Lines 630-636
fastcgi_spawn(fcgid_command * command, s
Link Here
|
630 |
} |
630 |
} |
631 |
} |
631 |
} |
632 |
|
632 |
|
633 |
apr_status_t pm_main(server_rec * main_server, apr_pool_t * configpool) |
633 |
apr_status_t pm_main(server_rec * main_server, apr_pool_t * configpool, |
|
|
634 |
server_rec * vhost_array[]) |
634 |
{ |
635 |
{ |
635 |
fcgid_command command; |
636 |
fcgid_command command; |
636 |
|
637 |
|
Lines 641-647
apr_status_t pm_main(server_rec * main_s
Link Here
|
641 |
/* Wait for command */ |
642 |
/* Wait for command */ |
642 |
if (procmgr_peek_cmd(&command, main_server) == APR_SUCCESS) { |
643 |
if (procmgr_peek_cmd(&command, main_server) == APR_SUCCESS) { |
643 |
if (is_spawn_allowed(main_server, &command)) |
644 |
if (is_spawn_allowed(main_server, &command)) |
644 |
fastcgi_spawn(&command, main_server, configpool); |
645 |
fastcgi_spawn(&command, main_server, vhost_array[command.vhost_id], configpool); |
645 |
|
646 |
|
646 |
procmgr_finish_notify(main_server); |
647 |
procmgr_finish_notify(main_server); |
647 |
} |
648 |
} |
648 |
-- a/modules/fcgid/fcgid_pm_main.h |
649 |
++ b/modules/fcgid/fcgid_pm_main.h |
Lines 18-23
Link Here
|
18 |
#ifndef FCGID_PM_MAIN_H |
18 |
#ifndef FCGID_PM_MAIN_H |
19 |
#define FCGID_PM_MAIN_H |
19 |
#define FCGID_PM_MAIN_H |
20 |
|
20 |
|
21 |
apr_status_t pm_main(server_rec * main_server, apr_pool_t * configpool); |
21 |
apr_status_t pm_main(server_rec * main_server, apr_pool_t * configpool, server_rec * vhost_array[]); |
22 |
|
22 |
|
23 |
#endif |
23 |
#endif |
24 |
-- a/modules/fcgid/fcgid_pm_unix.c |
24 |
++ b/modules/fcgid/fcgid_pm_unix.c |
Lines 302-308
create_process_manager(server_rec * main
Link Here
|
302 |
/* Initialize spawn controler */ |
302 |
/* Initialize spawn controler */ |
303 |
spawn_control_init(main_server, configpool); |
303 |
spawn_control_init(main_server, configpool); |
304 |
|
304 |
|
305 |
pm_main(main_server, configpool); |
305 |
int num_vhosts = 0; |
|
|
306 |
server_rec* server = main_server; |
307 |
while (server != NULL) { |
308 |
num_vhosts++; |
309 |
server = server->next; |
310 |
} |
311 |
ap_log_error(APLOG_MARK, APLOG_INFO, 0, main_server, |
312 |
"mod_fcgid: Process manager %" APR_PID_T_FMT ": num_vhosts = %d", getpid(), num_vhosts); |
313 |
|
314 |
server = main_server; |
315 |
server_rec* vhost_array[num_vhosts]; |
316 |
vhost_array[0] = main_server; |
317 |
int vhost_id; |
318 |
for (vhost_id=1; vhost_id < num_vhosts; vhost_id++) { |
319 |
server = server->next; |
320 |
vhost_array[vhost_id] = server; |
321 |
ap_log_error(APLOG_MARK, APLOG_INFO, 0, main_server, |
322 |
"mod_fcgid: Process manager %" APR_PID_T_FMT ": saving vhost_id %d", getpid(), vhost_id); |
323 |
} |
324 |
|
325 |
pm_main(main_server, configpool, vhost_array); |
306 |
|
326 |
|
307 |
ap_log_error(APLOG_MARK, APLOG_INFO, 0, main_server, |
327 |
ap_log_error(APLOG_MARK, APLOG_INFO, 0, main_server, |
308 |
"mod_fcgid: Process manager %" APR_PID_T_FMT " stopped", getpid()); |
328 |
"mod_fcgid: Process manager %" APR_PID_T_FMT " stopped", getpid()); |
309 |
-- a/modules/fcgid/fcgid_proc_unix.c |
329 |
++ b/modules/fcgid/fcgid_proc_unix.c |
Lines 192-198
static apr_status_t exec_setuid_cleanup(
Link Here
|
192 |
} |
192 |
} |
193 |
|
193 |
|
194 |
apr_status_t proc_spawn_process(const char *cmdline, fcgid_proc_info *procinfo, |
194 |
apr_status_t proc_spawn_process(const char *cmdline, fcgid_proc_info *procinfo, |
195 |
fcgid_procnode *procnode) |
195 |
server_rec * vhost, fcgid_procnode *procnode) |
196 |
{ |
196 |
{ |
197 |
server_rec *main_server = procinfo->main_server; |
197 |
server_rec *main_server = procinfo->main_server; |
198 |
fcgid_server_conf *sconf = ap_get_module_config(main_server->module_config, |
198 |
fcgid_server_conf *sconf = ap_get_module_config(main_server->module_config, |
Lines 358-367
apr_status_t proc_spawn_process(const ch
Link Here
|
358 |
/* Prepare the fork */ |
358 |
/* Prepare the fork */ |
359 |
if ((rv = apr_procattr_create(&procattr, procnode->proc_pool)) != APR_SUCCESS |
359 |
if ((rv = apr_procattr_create(&procattr, procnode->proc_pool)) != APR_SUCCESS |
360 |
|| (rv = apr_procattr_child_err_set(procattr, |
360 |
|| (rv = apr_procattr_child_err_set(procattr, |
361 |
procinfo->main_server->error_log, |
361 |
vhost->error_log, |
362 |
NULL)) != APR_SUCCESS |
362 |
NULL)) != APR_SUCCESS |
363 |
|| (rv = apr_procattr_child_out_set(procattr, |
363 |
|| (rv = apr_procattr_child_out_set(procattr, |
364 |
procinfo->main_server->error_log, |
364 |
vhost->error_log, |
365 |
NULL)) != APR_SUCCESS |
365 |
NULL)) != APR_SUCCESS |
366 |
|| (rv = apr_procattr_dir_set(procattr, |
366 |
|| (rv = apr_procattr_dir_set(procattr, |
367 |
ap_make_dirstr_parent(procnode->proc_pool, |
367 |
ap_make_dirstr_parent(procnode->proc_pool, |
368 |
-- a/modules/fcgid/fcgid_proc.h |
368 |
++ b/modules/fcgid/fcgid_proc.h |
Lines 41-46
typedef struct {
Link Here
|
41 |
|
41 |
|
42 |
apr_status_t proc_spawn_process(const char *cmdline, |
42 |
apr_status_t proc_spawn_process(const char *cmdline, |
43 |
fcgid_proc_info * procinfo, |
43 |
fcgid_proc_info * procinfo, |
|
|
44 |
server_rec * vhost, |
44 |
fcgid_procnode * procnode); |
45 |
fcgid_procnode * procnode); |
45 |
|
46 |
|
46 |
apr_status_t proc_kill_gracefully(fcgid_procnode * procnode, |
47 |
apr_status_t proc_kill_gracefully(fcgid_procnode * procnode, |