Apache2
|
![]() |
Data Structures | |
struct | ap_pod_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 |
Enumerations | |
enum | ap_podx_restart_t { AP_MPM_PODX_NORESTART, AP_MPM_PODX_RESTART, AP_MPM_PODX_GRACEFUL } |
#define AP_ACCEPT_MUTEX_TYPE "mpm-accept" |
#define AP_GRACEFUL_SHUTDOWN_TIMEOUT_COMMAND |
#define AP_MPM_PODX_GRACEFUL_CHAR '!' |
#define AP_MPM_PODX_RESTART_CHAR '$' |
#define AP_SIG_GRACEFUL SIGUSR1 |
#define AP_SIG_GRACEFUL_SHORT USR1 |
#define AP_SIG_GRACEFUL_STOP SIGWINCH |
#define AP_SIG_GRACEFUL_STOP_SHORT WINCH |
#define AP_SIG_GRACEFUL_STOP_STRING "SIGWINCH" |
#define AP_SIG_GRACEFUL_STRING "SIGUSR1" |
#define ap_sock_disable_nagle | ( | s | ) | /* NOOP */ |
#define DEFAULT_LISTENBACKLOG 511 |
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.
enum ap_podx_restart_t |
const char* ap_check_mpm | ( | void | ) |
Check that exactly one MPM is loaded Returns NULL if yes, error string if not.
void ap_core_child_status | ( | server_rec * | s, |
pid_t | pid, | ||
ap_generation_t | gen, | ||
int | slot, | ||
mpm_child_status | status | ||
) |
apr_status_t ap_fatal_signal_child_setup | ( | server_rec * | s | ) |
apr_status_t ap_fatal_signal_setup | ( | server_rec * | s, |
apr_pool_t * | in_pconf | ||
) |
gid_t ap_gname2id | ( | const char * | name | ) |
Convert a group name to a numeric ID
name | The name to convert |
void ap_mpm_dump_pidfile | ( | apr_pool_t * | p, |
apr_file_t * | out | ||
) |
apr_status_t ap_mpm_end_gen_helper | ( | void * | unused | ) |
Pool cleanup for end-generation hook implementation (core httpd function)
apr_status_t ap_mpm_pod_check | ( | ap_pod_t * | pod | ) |
Check the pipe to determine if the process has been signalled to die.
apr_status_t ap_mpm_pod_close | ( | ap_pod_t * | pod | ) |
Close the pipe-of-death
pod | the pipe-of-death to close. |
Write data to the pipe-of-death, signalling that all child process should die.
pod | The pipe-of-death to write to. |
num | The number of child processes to kill |
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.
p | The pool to use for allocating the pipe |
pod | the pipe-of-death that is created. |
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.
pod | the pipe-of-death to write to. |
Check the extended pipe to determine if the process has been signalled to die.
apr_status_t ap_mpm_podx_close | ( | ap_pod_t * | pod | ) |
Close the pipe-of-death
pod | The pipe-of-death to close. |
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.
pod | The pipe-of-death to write to. |
num | The number of child processes to kill |
graceful | restart-type |
apr_status_t ap_mpm_podx_open | ( | apr_pool_t * | p, |
ap_pod_t ** | pod | ||
) |
Open the extended pipe-of-death.
p | The pool to use for allocating the pipe |
pod | The pipe-of-death that is created. |
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.
pod | the pipe-of-death to write to. |
graceful | restart-type |
void ap_mpm_rewrite_args | ( | process_rec * | ) |
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.
pid | the process id of a child process to signal |
sig | the signal number to send |
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.
pid | The child that has died |
why | The return code of the child process |
status | The status returned from ap_wait_or_timeout |
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".
terminate | Either 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_callback | Callback invoked for each dead child 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.
pid | The process id of an MPM child process which should be reclaimed when ap_reclaim_child_processes() is called. |
gen | The generation of this MPM child process. |
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".
mpm_callback | Callback invoked for each dead child process |
int ap_signal_server | ( | int * | , |
apr_pool_t * | |||
) |
uid_t ap_uname2id | ( | const char * | name | ) |
Convert a username to a numeric ID
name | The name to convert |
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().
pid | The process id of an MPM child process which no longer needs to be reclaimed. |
old_gen | Set to the server generation of the process, if found. |
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.
status | The return code if a process has died |
exitcode | The returned exit status of the child, if a child process dies, or the signal that caused the child to die. |
ret | The process id of the process that died |
p | The pool to allocate out of |
s | The server_rec to pass |
int drop_privileges | ( | apr_pool_t * | pchild, |
server_rec * | s | ||
) |
void mpm_common_pre_config | ( | apr_pool_t * | pconf | ) |
apr_status_t mpm_register_poll_callback_timeout | ( | apr_pool_t * | p, |
const apr_array_header_t * | pds, | ||
ap_mpm_callback_fn_t * | cbfn, | ||
ap_mpm_callback_fn_t * | tofn, | ||
void * | baton, | ||
apr_time_t | timeout | ||
) |
AP_DECLARE_DATA char ap_coredump_dir[MAX_STRING_LEN] |
AP_DECLARE_DATA int ap_coredumpdir_configured |
AP_DECLARE_DATA int ap_graceful_shutdown_timeout |
Set the timeout period for a graceful shutdown.
AP_DECLARE_DATA apr_uint32_t ap_max_mem_free |
AP_DECLARE_DATA int ap_max_requests_per_child |
The maximum number of requests each child thread or process handles before dying off
AP_DECLARE_DATA const char* ap_pid_fname |
The filename used to store the process id.
AP_DECLARE_DATA apr_size_t ap_thread_stacksize |