Apache HTTPD
Classes | Macros | Typedefs | Enumerations | Functions | Variables
Multi-Processing Modules

Classes

struct  ap_pod_t
 
struct  ap_LINK_monitor_t
 
struct  ap_LINK_drop_privileges_t
 
struct  ap_LINK_mpm_query_t
 
struct  ap_LINK_mpm_register_timed_callback_t
 
struct  ap_LINK_mpm_get_name_t
 
struct  ap_LINK_suspend_connection_t
 
struct  ap_LINK_resume_connection_t
 
struct  ap_LINK_child_stopping_t
 

Macros

#define DEFAULT_LISTENBACKLOG   511
 
#define AP_SIG_GRACEFUL   SIGUSR1
 
#define AP_SIG_GRACEFUL_SHORT   USR1
 
#define AP_SIG_GRACEFUL_STRING   "SIGUSR1"
 
#define AP_SIG_GRACEFUL_STOP   SIGWINCH
 
#define AP_SIG_GRACEFUL_STOP_SHORT   WINCH
 
#define AP_SIG_GRACEFUL_STOP_STRING   "SIGWINCH"
 
#define ap_sock_disable_nagle(s)   /* NOOP */
 
#define AP_MPM_PODX_RESTART_CHAR   '$'
 
#define AP_MPM_PODX_GRACEFUL_CHAR   '!'
 
#define AP_GRACEFUL_SHUTDOWN_TIMEOUT_COMMAND
 
#define AP_ACCEPT_MUTEX_TYPE   "mpm-accept"
 

Typedefs

typedef void ap_reclaim_callback_fn_t(int childnum, pid_t pid, ap_generation_t gen)
 
typedef struct ap_pod_t ap_pod_t
 
typedef int ap_HOOK_monitor_t(apr_pool_t *p, server_rec *s)
 
typedef struct ap_LINK_monitor_t ap_LINK_monitor_t
 
typedef int ap_HOOK_drop_privileges_t(apr_pool_t *pchild, server_rec *s)
 
typedef struct ap_LINK_drop_privileges_t ap_LINK_drop_privileges_t
 
typedef int ap_HOOK_mpm_query_t(int query_code, int *result, apr_status_t *rv)
 
typedef struct ap_LINK_mpm_query_t ap_LINK_mpm_query_t
 
typedef apr_status_t ap_HOOK_mpm_register_timed_callback_t(apr_time_t t, ap_mpm_callback_fn_t *cbfn, void *baton)
 
typedef struct ap_LINK_mpm_register_timed_callback_t ap_LINK_mpm_register_timed_callback_t
 
typedef const charap_HOOK_mpm_get_name_t(void)
 
typedef struct ap_LINK_mpm_get_name_t ap_LINK_mpm_get_name_t
 
typedef struct ap_LINK_suspend_connection_t ap_LINK_suspend_connection_t
 
typedef struct ap_LINK_resume_connection_t ap_LINK_resume_connection_t
 
typedef void ap_HOOK_child_stopping_t(apr_pool_t *pchild, int graceful)
 
typedef struct ap_LINK_child_stopping_t ap_LINK_child_stopping_t
 

Enumerations

enum  ap_podx_restart_t { AP_MPM_PODX_NORESTART , AP_MPM_PODX_RESTART , AP_MPM_PODX_GRACEFUL }
 

Functions

void ap_reclaim_child_processes (int terminate, ap_reclaim_callback_fn_t *mpm_callback)
 
void ap_relieve_child_processes (ap_reclaim_callback_fn_t *mpm_callback)
 
void ap_register_extra_mpm_process (pid_t pid, ap_generation_t gen)
 
int ap_unregister_extra_mpm_process (pid_t pid, ap_generation_t *old_gen)
 
apr_status_t ap_mpm_safe_kill (pid_t pid, int sig)
 
int ap_process_child_status (apr_proc_t *pid, apr_exit_why_e why, int status)
 
apr_status_t ap_fatal_signal_setup (server_rec *s, apr_pool_t *in_pconf)
 
apr_status_t ap_fatal_signal_child_setup (server_rec *s)
 
apr_status_t ap_mpm_end_gen_helper (void *unused)
 
void ap_wait_or_timeout (apr_exit_why_e *status, int *exitcode, apr_proc_t *ret, apr_pool_t *p, server_rec *s)
 
int initgroups (const char *name, gid_t basegid)
 
apr_status_t ap_mpm_pod_open (apr_pool_t *p, ap_pod_t **pod)
 
apr_status_t ap_mpm_pod_check (ap_pod_t *pod)
 
apr_status_t ap_mpm_pod_close (ap_pod_t *pod)
 
apr_status_t ap_mpm_pod_signal (ap_pod_t *pod)
 
void ap_mpm_pod_killpg (ap_pod_t *pod, int num)
 
apr_status_t ap_mpm_podx_open (apr_pool_t *p, ap_pod_t **pod)
 
int ap_mpm_podx_check (ap_pod_t *pod)
 
apr_status_t ap_mpm_podx_close (ap_pod_t *pod)
 
apr_status_t ap_mpm_podx_signal (ap_pod_t *pod, ap_podx_restart_t graceful)
 
void ap_mpm_podx_killpg (ap_pod_t *pod, int num, ap_podx_restart_t graceful)
 
const charap_check_mpm (void)
 
const charap_mpm_set_max_requests (cmd_parms *cmd, void *dummy, const char *arg)
 
const charap_mpm_set_pidfile (cmd_parms *cmd, void *dummy, const char *arg)
 
void ap_mpm_dump_pidfile (apr_pool_t *p, apr_file_t *out)
 
const charap_mpm_set_coredumpdir (cmd_parms *cmd, void *dummy, const char *arg)
 
const charap_mpm_set_graceful_shutdown (cmd_parms *cmd, void *dummy, const char *arg)
 
int ap_signal_server (int *, apr_pool_t *)
 
void ap_mpm_rewrite_args (process_rec *)
 
const charap_mpm_set_max_mem_free (cmd_parms *cmd, void *dummy, const char *arg)
 
const charap_mpm_set_thread_stacksize (cmd_parms *cmd, void *dummy, const char *arg)
 
void ap_core_child_status (server_rec *s, pid_t pid, ap_generation_t gen, int slot, mpm_child_status status)
 
void ap_hook_monitor (ap_HOOK_monitor_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
 
int ap_run_monitor (apr_pool_t *p, server_rec *s)
 
apr_array_header_tap_hook_get_monitor (void)
 
int ap_sys_privileges_handlers (int inc)
 
void ap_hook_drop_privileges (ap_HOOK_drop_privileges_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
 
int ap_run_drop_privileges (apr_pool_t *pchild, server_rec *s)
 
apr_array_header_tap_hook_get_drop_privileges (void)
 
void ap_hook_mpm_query (ap_HOOK_mpm_query_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
 
int ap_run_mpm_query (int query_code, int *result, apr_status_t *rv)
 
apr_array_header_tap_hook_get_mpm_query (void)
 
void ap_hook_mpm_register_timed_callback (ap_HOOK_mpm_register_timed_callback_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
 
apr_status_t ap_run_mpm_register_timed_callback (apr_time_t t, ap_mpm_callback_fn_t *cbfn, void *baton)
 
apr_array_header_tap_hook_get_mpm_register_timed_callback (void)
 
void ap_hook_mpm_get_name (ap_HOOK_mpm_get_name_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
 
const charap_run_mpm_get_name (void)
 
apr_array_header_tap_hook_get_mpm_get_name (void)
 
void ap_hook_suspend_connection (ap_HOOK_suspend_connection_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
 
void ap_run_suspend_connection (conn_rec *c, request_rec *r)
 
apr_array_header_tap_hook_get_suspend_connection (void)
 
void ap_hook_resume_connection (ap_HOOK_resume_connection_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
 
void ap_run_resume_connection (conn_rec *c, request_rec *r)
 
apr_array_header_tap_hook_get_resume_connection (void)
 
void ap_hook_child_stopping (ap_HOOK_child_stopping_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
 
void ap_run_child_stopping (apr_pool_t *pchild, int graceful)
 
apr_array_header_tap_hook_get_child_stopping (void)
 
void mpm_common_pre_config (apr_pool_t *pconf)
 

Variables

int ap_max_requests_per_child
 
const charap_pid_fname
 
char ap_coredump_dir [8192]
 
int ap_coredumpdir_configured
 
int ap_graceful_shutdown_timeout
 
apr_uint32_t ap_max_mem_free
 
apr_size_t ap_thread_stacksize
 

Detailed Description

Macro Definition Documentation

◆ AP_ACCEPT_MUTEX_TYPE

#define AP_ACCEPT_MUTEX_TYPE   "mpm-accept"

Definition at line 467 of file mpm_common.h.

◆ AP_GRACEFUL_SHUTDOWN_TIMEOUT_COMMAND

#define AP_GRACEFUL_SHUTDOWN_TIMEOUT_COMMAND
Value:
AP_INIT_TAKE1("GracefulShutdownTimeout", ap_mpm_set_graceful_shutdown, NULL, \
RSRC_CONF, "Maximum time in seconds to wait for child " \
"processes to complete transactions during shutdown")
#define AP_INIT_TAKE1(directive, func, mconfig, where, help)
const char * ap_mpm_set_graceful_shutdown(cmd_parms *cmd, void *dummy, const char *arg)
Definition mpm_common.c:369
#define RSRC_CONF
return NULL
Definition mod_so.c:359

Definition at line 369 of file mpm_common.h.

◆ AP_MPM_PODX_GRACEFUL_CHAR

#define AP_MPM_PODX_GRACEFUL_CHAR   '!'

Definition at line 282 of file mpm_common.h.

◆ AP_MPM_PODX_RESTART_CHAR

#define AP_MPM_PODX_RESTART_CHAR   '$'

Definition at line 281 of file mpm_common.h.

◆ AP_SIG_GRACEFUL

#define AP_SIG_GRACEFUL   SIGUSR1

Definition at line 67 of file mpm_common.h.

◆ AP_SIG_GRACEFUL_SHORT

#define AP_SIG_GRACEFUL_SHORT   USR1

Definition at line 70 of file mpm_common.h.

◆ AP_SIG_GRACEFUL_STOP

#define AP_SIG_GRACEFUL_STOP   SIGWINCH

Definition at line 76 of file mpm_common.h.

◆ AP_SIG_GRACEFUL_STOP_SHORT

#define AP_SIG_GRACEFUL_STOP_SHORT   WINCH

Definition at line 79 of file mpm_common.h.

◆ AP_SIG_GRACEFUL_STOP_STRING

#define AP_SIG_GRACEFUL_STOP_STRING   "SIGWINCH"

Definition at line 82 of file mpm_common.h.

◆ AP_SIG_GRACEFUL_STRING

#define AP_SIG_GRACEFUL_STRING   "SIGUSR1"

Definition at line 73 of file mpm_common.h.

◆ ap_sock_disable_nagle

#define ap_sock_disable_nagle (   s)    /* NOOP */

Definition at line 200 of file mpm_common.h.

◆ DEFAULT_LISTENBACKLOG

#define DEFAULT_LISTENBACKLOG   511

Definition at line 63 of file mpm_common.h.

Typedef Documentation

◆ ap_HOOK_child_stopping_t

typedef void ap_HOOK_child_stopping_t(apr_pool_t *pchild, int graceful)

Notification that the child is stopping. If graceful, ongoing requests will be served.

Parameters
pchildThe child pool
graceful!= 0 iff this is a graceful shutdown.

Definition at line 462 of file mpm_common.h.

◆ ap_HOOK_drop_privileges_t

typedef int ap_HOOK_drop_privileges_t(apr_pool_t *pchild, server_rec *s)

Definition at line 399 of file mpm_common.h.

◆ ap_HOOK_monitor_t

typedef int ap_HOOK_monitor_t(apr_pool_t *p, server_rec *s)

Definition at line 395 of file mpm_common.h.

◆ ap_HOOK_mpm_get_name_t

typedef const char * ap_HOOK_mpm_get_name_t(void)

Definition at line 412 of file mpm_common.h.

◆ ap_HOOK_mpm_query_t

typedef int ap_HOOK_mpm_query_t(int query_code, int *result, apr_status_t *rv)

Definition at line 405 of file mpm_common.h.

◆ ap_HOOK_mpm_register_timed_callback_t

typedef apr_status_t ap_HOOK_mpm_register_timed_callback_t(apr_time_t t, ap_mpm_callback_fn_t *cbfn, void *baton)

Definition at line 409 of file mpm_common.h.

◆ ap_LINK_child_stopping_t

◆ ap_LINK_drop_privileges_t

◆ ap_LINK_monitor_t

◆ ap_LINK_mpm_get_name_t

◆ ap_LINK_mpm_query_t

◆ ap_LINK_mpm_register_timed_callback_t

◆ ap_LINK_resume_connection_t

◆ ap_LINK_suspend_connection_t

◆ ap_pod_t

Definition at line 238 of file mpm_common.h.

◆ ap_reclaim_callback_fn_t

typedef void ap_reclaim_callback_fn_t(int childnum, pid_t pid, ap_generation_t gen)

Callback function used for ap_reclaim_child_processes() and ap_relieve_child_processes(). The callback function will be called for each terminated child process.

Definition at line 89 of file mpm_common.h.

Enumeration Type Documentation

◆ ap_podx_restart_t

Enumerator
AP_MPM_PODX_NORESTART 
AP_MPM_PODX_RESTART 
AP_MPM_PODX_GRACEFUL 

Definition at line 284 of file mpm_common.h.

Function Documentation

◆ ap_check_mpm()

const char * ap_check_mpm ( void  )

Check that exactly one MPM is loaded Returns NULL if yes, error string if not.

Definition at line 559 of file mpm_common.c.

◆ ap_core_child_status()

void ap_core_child_status ( server_rec s,
pid_t  pid,
ap_generation_t  gen,
int  slot,
mpm_child_status  status 
)
extern

Definition at line 477 of file mpm_common.c.

◆ ap_fatal_signal_child_setup()

apr_status_t ap_fatal_signal_child_setup ( server_rec s)

Definition at line 1011 of file mpm_unix.c.

◆ ap_fatal_signal_setup()

apr_status_t ap_fatal_signal_setup ( server_rec s,
apr_pool_t in_pconf 
)

Definition at line 1044 of file mpm_unix.c.

◆ ap_hook_child_stopping()

void ap_hook_child_stopping ( ap_HOOK_child_stopping_t pf,
const char *const aszPre,
const char *const aszSucc,
int  nOrder 
)

Definition at line 118 of file mpm_common.c.

◆ ap_hook_drop_privileges()

void ap_hook_drop_privileges ( ap_HOOK_drop_privileges_t pf,
const char *const aszPre,
const char *const aszSucc,
int  nOrder 
)

Definition at line 94 of file mpm_common.c.

◆ ap_hook_get_child_stopping()

apr_array_header_t * ap_hook_get_child_stopping ( void  )

Definition at line 118 of file mpm_common.c.

◆ ap_hook_get_drop_privileges()

apr_array_header_t * ap_hook_get_drop_privileges ( void  )

Definition at line 94 of file mpm_common.c.

◆ ap_hook_get_monitor()

apr_array_header_t * ap_hook_get_monitor ( void  )

Definition at line 91 of file mpm_common.c.

◆ ap_hook_get_mpm_get_name()

apr_array_header_t * ap_hook_get_mpm_get_name ( void  )

Definition at line 136 of file mpm_common.c.

◆ ap_hook_get_mpm_query()

apr_array_header_t * ap_hook_get_mpm_query ( void  )

Definition at line 100 of file mpm_common.c.

◆ ap_hook_get_mpm_register_timed_callback()

apr_array_header_t * ap_hook_get_mpm_register_timed_callback ( void  )

Definition at line 103 of file mpm_common.c.

◆ ap_hook_get_resume_connection()

apr_array_header_t * ap_hook_get_resume_connection ( void  )

Definition at line 115 of file mpm_common.c.

◆ ap_hook_get_suspend_connection()

apr_array_header_t * ap_hook_get_suspend_connection ( void  )

Definition at line 112 of file mpm_common.c.

◆ ap_hook_monitor()

void ap_hook_monitor ( ap_HOOK_monitor_t pf,
const char *const aszPre,
const char *const aszSucc,
int  nOrder 
)

Definition at line 91 of file mpm_common.c.

◆ ap_hook_mpm_get_name()

void ap_hook_mpm_get_name ( ap_HOOK_mpm_get_name_t pf,
const char *const aszPre,
const char *const aszSucc,
int  nOrder 
)

Definition at line 136 of file mpm_common.c.

◆ ap_hook_mpm_query()

void ap_hook_mpm_query ( ap_HOOK_mpm_query_t pf,
const char *const aszPre,
const char *const aszSucc,
int  nOrder 
)

Definition at line 100 of file mpm_common.c.

◆ ap_hook_mpm_register_timed_callback()

void ap_hook_mpm_register_timed_callback ( ap_HOOK_mpm_register_timed_callback_t pf,
const char *const aszPre,
const char *const aszSucc,
int  nOrder 
)

Definition at line 103 of file mpm_common.c.

◆ ap_hook_resume_connection()

void ap_hook_resume_connection ( ap_HOOK_resume_connection_t pf,
const char *const aszPre,
const char *const aszSucc,
int  nOrder 
)

Definition at line 115 of file mpm_common.c.

◆ ap_hook_suspend_connection()

void ap_hook_suspend_connection ( ap_HOOK_suspend_connection_t pf,
const char *const aszPre,
const char *const aszSucc,
int  nOrder 
)

Definition at line 112 of file mpm_common.c.

◆ ap_mpm_dump_pidfile()

void ap_mpm_dump_pidfile ( apr_pool_t p,
apr_file_t out 
)

Definition at line 316 of file mpm_common.c.

◆ ap_mpm_end_gen_helper()

apr_status_t ap_mpm_end_gen_helper ( void *  unused)

Pool cleanup for end-generation hook implementation (core httpd function)

Definition at line 441 of file mpm_common.c.

◆ ap_mpm_pod_check()

apr_status_t ap_mpm_pod_check ( ap_pod_t pod)

Check the pipe to determine if the process has been signalled to die.

Definition at line 468 of file mpm_unix.c.

◆ ap_mpm_pod_close()

apr_status_t ap_mpm_pod_close ( ap_pod_t pod)

Close the pipe-of-death

Parameters
podthe pipe-of-death to close.

Definition at line 487 of file mpm_unix.c.

◆ ap_mpm_pod_killpg()

void ap_mpm_pod_killpg ( ap_pod_t pod,
int  num 
)

Write data to the pipe-of-death, signalling that all child process should die.

Parameters
podThe pipe-of-death to write to.
numThe number of child processes to kill

Definition at line 743 of file mpm_unix.c.

◆ ap_mpm_pod_open()

apr_status_t ap_mpm_pod_open ( apr_pool_t p,
ap_pod_t **  pod 
)

Open the pipe-of-death. The pipe of death is used to tell all child processes that it is time to die gracefully.

Parameters
pThe pool to use for allocating the pipe
podthe pipe-of-death that is created.

Definition at line 447 of file mpm_unix.c.

◆ ap_mpm_pod_signal()

apr_status_t ap_mpm_pod_signal ( ap_pod_t pod)

Write data to the pipe-of-death, signalling that one child process should die.

Parameters
podthe pipe-of-death to write to.

Definition at line 731 of file mpm_unix.c.

◆ ap_mpm_podx_check()

int ap_mpm_podx_check ( ap_pod_t pod)

Check the extended pipe to determine if the process has been signalled to die.

Definition at line 540 of file mpm_unix.c.

◆ ap_mpm_podx_close()

apr_status_t ap_mpm_podx_close ( ap_pod_t pod)

Close the pipe-of-death

Parameters
podThe pipe-of-death to close.

Definition at line 562 of file mpm_unix.c.

◆ ap_mpm_podx_killpg()

void ap_mpm_podx_killpg ( ap_pod_t pod,
int  num,
ap_podx_restart_t  graceful 
)

Write data to the extended pipe-of-death, signalling that all child process should die.

Parameters
podThe pipe-of-death to write to.
numThe number of child processes to kill
gracefulrestart-type

Definition at line 609 of file mpm_unix.c.

◆ ap_mpm_podx_open()

apr_status_t ap_mpm_podx_open ( apr_pool_t p,
ap_pod_t **  pod 
)

Open the extended pipe-of-death.

Parameters
pThe pool to use for allocating the pipe
podThe pipe-of-death that is created.

Definition at line 519 of file mpm_unix.c.

◆ ap_mpm_podx_signal()

apr_status_t ap_mpm_podx_signal ( ap_pod_t pod,
ap_podx_restart_t  graceful 
)

Write data to the extended pipe-of-death, signalling that one child process should die.

Parameters
podthe pipe-of-death to write to.
gracefulrestart-type

Definition at line 603 of file mpm_unix.c.

◆ ap_mpm_rewrite_args()

void ap_mpm_rewrite_args ( process_rec process)

Definition at line 872 of file mpm_unix.c.

◆ ap_mpm_safe_kill()

apr_status_t ap_mpm_safe_kill ( pid_t  pid,
int  sig 
)

Safely signal an MPM child process, if the process is in the current process group. Otherwise fail.

Parameters
pidthe process id of a child process to signal
sigthe signal number to send
Returns
APR_SUCCESS if signal is sent, otherwise an error as per kill(3); APR_EINVAL is returned if passed either an invalid (< 1) pid, or if the pid is not in the current process group

Definition at line 331 of file mpm_unix.c.

◆ ap_mpm_set_coredumpdir()

const char * ap_mpm_set_coredumpdir ( cmd_parms cmd,
void *  dummy,
const char arg 
)

< Forbidden in <VirtualHost>

< Forbidden in <Limit>

< Forbidden in <Directory>

< Forbidden in <Location>

< Forbidden in <Files> or <If>

< Forbidden in <Proxy>

< Type

Definition at line 341 of file mpm_common.c.

◆ ap_mpm_set_graceful_shutdown()

const char * ap_mpm_set_graceful_shutdown ( cmd_parms cmd,
void *  dummy,
const char arg 
)

< Forbidden in <VirtualHost>

< Forbidden in <Limit>

< Forbidden in <Directory>

< Forbidden in <Location>

< Forbidden in <Files> or <If>

< Forbidden in <Proxy>

Definition at line 369 of file mpm_common.c.

◆ ap_mpm_set_max_mem_free()

const char * ap_mpm_set_max_mem_free ( cmd_parms cmd,
void *  dummy,
const char arg 
)
extern

< Forbidden in <VirtualHost>

< Forbidden in <Limit>

< Forbidden in <Directory>

< Forbidden in <Location>

< Forbidden in <Files> or <If>

< Forbidden in <Proxy>

Definition at line 381 of file mpm_common.c.

◆ ap_mpm_set_max_requests()

const char * ap_mpm_set_max_requests ( cmd_parms cmd,
void *  dummy,
const char arg 
)

< Forbidden in <VirtualHost>

< Forbidden in <Limit>

< Forbidden in <Directory>

< Forbidden in <Location>

< Forbidden in <Files> or <If>

< Forbidden in <Proxy>

Definition at line 322 of file mpm_common.c.

◆ ap_mpm_set_pidfile()

const char * ap_mpm_set_pidfile ( cmd_parms cmd,
void *  dummy,
const char arg 
)

< Forbidden in <VirtualHost>

< Forbidden in <Limit>

< Forbidden in <Directory>

< Forbidden in <Location>

< Forbidden in <Files> or <If>

< Forbidden in <Proxy>

Definition at line 300 of file mpm_common.c.

◆ ap_mpm_set_thread_stacksize()

const char * ap_mpm_set_thread_stacksize ( cmd_parms cmd,
void *  dummy,
const char arg 
)
extern

< Forbidden in <VirtualHost>

< Forbidden in <Limit>

< Forbidden in <Directory>

< Forbidden in <Location>

< Forbidden in <Files> or <If>

< Forbidden in <Proxy>

Definition at line 401 of file mpm_common.c.

◆ ap_process_child_status()

int ap_process_child_status ( apr_proc_t pid,
apr_exit_why_e  why,
int  status 
)

Log why a child died to the error log, if the child died without the parent signalling it.

Parameters
pidThe child that has died
whyThe return code of the child process
statusThe status returned from ap_wait_or_timeout
Returns
0 on success, APEXIT_CHILDFATAL if MPM should terminate

Definition at line 386 of file mpm_unix.c.

◆ ap_reclaim_child_processes()

void ap_reclaim_child_processes ( int  terminate,
ap_reclaim_callback_fn_t mpm_callback 
)

Make sure all child processes that have been spawned by the parent process have died. This includes process registered as "other_children".

Parameters
terminateEither 1 or 0. If 1, send the child processes SIGTERM each time through the loop. If 0, give the process time to die on its own before signalling it.
mpm_callbackCallback invoked for each dead child process
Note
The MPM child processes which are reclaimed are those listed in the scoreboard as well as those currently registered via ap_register_extra_mpm_process().

Definition at line 184 of file mpm_unix.c.

◆ ap_register_extra_mpm_process()

void ap_register_extra_mpm_process ( pid_t  pid,
ap_generation_t  gen 
)

Tell ap_reclaim_child_processes() and ap_relieve_child_processes() about an MPM child process which has no entry in the scoreboard.

Parameters
pidThe process id of an MPM child process which should be reclaimed when ap_reclaim_child_processes() is called.
genThe generation of this MPM child process.
Note
If an extra MPM child process terminates prior to calling ap_reclaim_child_processes(), remove it from the list of such processes by calling ap_unregister_extra_mpm_process().

Definition at line 82 of file mpm_unix.c.

◆ ap_relieve_child_processes()

void ap_relieve_child_processes ( ap_reclaim_callback_fn_t mpm_callback)

Catch any child processes that have been spawned by the parent process which have exited. This includes processes registered as "other_children".

Parameters
mpm_callbackCallback invoked for each dead child process
Note
The MPM child processes which are relieved are those listed in the scoreboard as well as those currently registered via ap_register_extra_mpm_process().

Definition at line 286 of file mpm_unix.c.

◆ ap_run_child_stopping()

void ap_run_child_stopping ( apr_pool_t pchild,
int  graceful 
)

Definition at line 118 of file mpm_common.c.

◆ ap_run_drop_privileges()

int ap_run_drop_privileges ( apr_pool_t pchild,
server_rec s 
)

< Module has handled this stage.

< Module has handled this stage.

< Module declines to handle

< Module has handled this stage.

Definition at line 94 of file mpm_common.c.

◆ ap_run_monitor()

int ap_run_monitor ( apr_pool_t p,
server_rec s 
)

< Module has handled this stage.

< Module has handled this stage.

< Module declines to handle

< Module has handled this stage.

Definition at line 91 of file mpm_common.c.

◆ ap_run_mpm_get_name()

const char * ap_run_mpm_get_name ( void  )

Definition at line 136 of file mpm_common.c.

◆ ap_run_mpm_query()

int ap_run_mpm_query ( int  query_code,
int result,
apr_status_t rv 
)

< Module declines to handle

< Module declines to handle

Definition at line 100 of file mpm_common.c.

◆ ap_run_mpm_register_timed_callback()

apr_status_t ap_run_mpm_register_timed_callback ( apr_time_t  t,
ap_mpm_callback_fn_t cbfn,
void *  baton 
)

Definition at line 103 of file mpm_common.c.

◆ ap_run_resume_connection()

void ap_run_resume_connection ( conn_rec c,
request_rec r 
)

Definition at line 115 of file mpm_common.c.

◆ ap_run_suspend_connection()

void ap_run_suspend_connection ( conn_rec c,
request_rec r 
)

Definition at line 112 of file mpm_common.c.

◆ ap_signal_server()

int ap_signal_server ( int exit_status,
apr_pool_t pconf 
)

Definition at line 784 of file mpm_unix.c.

◆ ap_sys_privileges_handlers()

int ap_sys_privileges_handlers ( int  inc)

Definition at line 5062 of file core.c.

◆ ap_unregister_extra_mpm_process()

int ap_unregister_extra_mpm_process ( pid_t  pid,
ap_generation_t old_gen 
)

Unregister an MPM child process which was previously registered by a call to ap_register_extra_mpm_process().

Parameters
pidThe process id of an MPM child process which no longer needs to be reclaimed.
old_genSet to the server generation of the process, if found.
Returns
1 if the process was found and removed, 0 otherwise

Definition at line 92 of file mpm_unix.c.

◆ ap_wait_or_timeout()

void ap_wait_or_timeout ( apr_exit_why_e status,
int exitcode,
apr_proc_t ret,
apr_pool_t p,
server_rec s 
)

Run the monitor hook (once every ten calls), determine if any child process has died and, if none died, sleep one second.

Parameters
statusThe return code if a process has died
exitcodeThe returned exit status of the child, if a child process dies, or the signal that caused the child to die.
retThe process id of the process that died
pThe pool to allocate out of
sThe server_rec to pass

Definition at line 181 of file mpm_common.c.

◆ initgroups()

int initgroups ( const char name,
gid_t  basegid 
)

The initgroups() function initializes the group access list by reading the group database /etc/group and using all groups of which user is a member. The additional group basegid is also added to the list.

Parameters
nameThe user name - must be non-NULL
basegidThe basegid to add
Returns
returns 0 on success

Definition at line 267 of file mpm_common.c.

◆ mpm_common_pre_config()

void mpm_common_pre_config ( apr_pool_t pconf)

Definition at line 164 of file mpm_common.c.

Variable Documentation

◆ ap_coredump_dir

char ap_coredump_dir[ 8192]
extern

Definition at line 152 of file mpm_common.c.

◆ ap_coredumpdir_configured

int ap_coredumpdir_configured
extern

Definition at line 153 of file mpm_common.c.

◆ ap_graceful_shutdown_timeout

int ap_graceful_shutdown_timeout
extern

Set the timeout period for a graceful shutdown.

Definition at line 154 of file mpm_common.c.

◆ ap_max_mem_free

apr_uint32_t ap_max_mem_free
extern

Definition at line 155 of file mpm_common.c.

◆ ap_max_requests_per_child

int ap_max_requests_per_child
extern

The maximum number of requests each child thread or process handles before dying off

Definition at line 151 of file mpm_common.c.

◆ ap_pid_fname

const char* ap_pid_fname
extern

The filename used to store the process id.

Definition at line 150 of file mpm_common.c.

◆ ap_thread_stacksize

apr_size_t ap_thread_stacksize
extern

Definition at line 156 of file mpm_common.c.