Changes with Apache 2.0.32-dev
+ *) Not being able to bind to the socket is a fatal error. We should
+ print an error to the console, and return a non-zero status code.
+ With these changes, all of the Unix MPMs do that correctly.
+ [Ryan Bloom]
+
*) suexec: Allow HTTPS and SSL_* environment variables to be passed
through to CGI scripts. PR 9163
[Brian Reid <breid@customlogic.com>,
APACHE 2.0 STATUS: -*-text-*-
-Last modified at [$Date: 2002/02/04 17:40:32 $]
+Last modified at [$Date: 2002/02/04 18:41:45 $]
Release:
RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
- * Runtime startup failures don't reliably set the exit status.
- For instance, try listening to port 80 and starting as non-root;
- server fails with make_sock and 'no listening sockets' errors
- but exits with 0 status. Even with -DONE_PROCESS -DNO_DETACH.
- Justin says: "Is this really a showstopper? Most people won't
- be using -DNO_DETACH and will look at the error
- logs anyway."
- Ken says: "Yes, it's a showstopper -- because it exits with
- a 0 status on startup failure, whether it spawns
- or not, before doing any work. A script will
- incorrectly think it successfully daemonised."
- Showstopper: Ken, BrianP, Martin
- Not a showstopper: trawick, stoddard, Jim, Justin, Aaron
-
* The Add...Filter and Set...Filter directives do not allow the
administrator to order filters, beyond the order of filename (mime)
extensions. It isn't clear if Set...Filter(s) should be inserted
apr_status_t rv;
apr_size_t one = 1;
- pconf = _pconf;
- ap_server_conf = s;
+ ap_log_pid(pconf, ap_pid_fname);
+
first_server_limit = server_limit;
first_thread_limit = thread_limit;
if (changed_limit_at_restart) {
"no listening sockets available, shutting down");
return 1;
}
- ap_log_pid(pconf, ap_pid_fname);
/* Initialize cross-process accept lock */
ap_lock_fname = apr_psprintf(_pconf, "%s.%u",
return 0;
}
+/* This really should be a post_config hook, but the error log is already
+ * redirected by that point, so we need to do this in the open_logs phase.
+ */
+static int perchild_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
+{
+ apr_status_t rv;
+
+ pconf = p;
+ ap_server_conf = s;
+
+ if ((num_listensocks = ap_setup_listeners(ap_server_conf)) < 1) {
+ ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ALERT|APLOG_STARTUP, 0,
+ NULL, "no listening sockets available, shutting down");
+ return DONE;
+ }
+
+ ap_log_pid(pconf, ap_pid_fname);
+
+ if ((rv = ap_mpm_pod_open(pconf, &pod))) {
+ ap_log_error(APLOG_MARK, APLOG_CRIT|APLOG_STARTUP, rv, NULL,
+ "Could not open pipe-of-death.");
+ return DONE;
+ }
+ return OK;
+}
+
static int perchild_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
{
static int restart_num = 0;
static void perchild_hooks(apr_pool_t *p)
{
+ /* The perchild open_logs phase must run before the core's, or stderr
+ * will be redirected to a file, and the messages won't print to the
+ * console.
+ */
+ static const char *const aszSucc[] = {"core.c", NULL};
one_process = 0;
+ ap_hook_open_logs(perchild_open_logs, NULL, aszSucc, APR_HOOK_MIDDLE);
ap_hook_pre_config(perchild_pre_config, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_post_config(perchild_post_config, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_pre_connection(perchild_pre_connection,NULL,NULL, APR_HOOK_MIDDLE);
apr_status_t rv;
apr_size_t one = 1;
- pconf = _pconf;
- ap_server_conf = s;
+ ap_log_pid(pconf, ap_pid_fname);
+
first_server_limit = server_limit;
first_thread_limit = thread_limit;
if (changed_limit_at_restart) {
"no listening sockets available, shutting down");
return 1;
}
- ap_log_pid(pconf, ap_pid_fname);
/* Initialize cross-process accept lock */
ap_lock_fname = apr_psprintf(_pconf, "%s.%u",
return 0;
}
+/* This really should be a post_config hook, but the error log is already
+ * redirected by that point, so we need to do this in the open_logs phase.
+ */
+static int perchild_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
+{
+ apr_status_t rv;
+
+ pconf = p;
+ ap_server_conf = s;
+
+ if ((num_listensocks = ap_setup_listeners(ap_server_conf)) < 1) {
+ ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ALERT|APLOG_STARTUP, 0,
+ NULL, "no listening sockets available, shutting down");
+ return DONE;
+ }
+
+ ap_log_pid(pconf, ap_pid_fname);
+
+ if ((rv = ap_mpm_pod_open(pconf, &pod))) {
+ ap_log_error(APLOG_MARK, APLOG_CRIT|APLOG_STARTUP, rv, NULL,
+ "Could not open pipe-of-death.");
+ return DONE;
+ }
+ return OK;
+}
+
static int perchild_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
{
static int restart_num = 0;
static void perchild_hooks(apr_pool_t *p)
{
+ /* The perchild open_logs phase must run before the core's, or stderr
+ * will be redirected to a file, and the messages won't print to the
+ * console.
+ */
+ static const char *const aszSucc[] = {"core.c", NULL};
one_process = 0;
+ ap_hook_open_logs(perchild_open_logs, NULL, aszSucc, APR_HOOK_MIDDLE);
ap_hook_pre_config(perchild_pre_config, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_post_config(perchild_post_config, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_pre_connection(perchild_pre_connection,NULL,NULL, APR_HOOK_MIDDLE);
int index;
int remaining_children_to_start;
+ ap_log_pid(pconf, ap_pid_fname);
+
first_server_limit = server_limit;
if (changed_limit_at_restart) {
ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 0, s,
return 0;
}
-
/* This really should be a post_config hook, but the error log is already
* redirected by that point, so we need to do this in the open_logs phase.
*/
return DONE;
}
- ap_log_pid(pconf, ap_pid_fname);
-
if ((rv = ap_mpm_pod_open(pconf, &pod))) {
ap_log_error(APLOG_MARK, APLOG_CRIT|APLOG_STARTUP, rv, NULL,
"Could not open pipe-of-death.");
static void prefork_hooks(apr_pool_t *p)
{
+ /* The prefork open_logs phase must run before the core's, or stderr
+ * will be redirected to a file, and the messages won't print to the
+ * console.
+ */
static const char *const aszSucc[] = {"core.c", NULL};
-
#ifdef AUX3
(void) set42sig();
#endif
int remaining_children_to_start;
apr_status_t rv;
- pconf = _pconf;
- ap_server_conf = s;
+ ap_log_pid(pconf, ap_pid_fname);
+
first_server_limit = server_limit;
first_thread_limit = thread_limit;
if (changed_limit_at_restart) {
changed_limit_at_restart = 0;
}
- if ((num_listensocks = ap_setup_listeners(ap_server_conf)) < 1) {
- /* XXX: hey, what's the right way for the mpm to indicate a fatal error? */
- ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ALERT, 0, s,
- "no listening sockets available, shutting down");
- return 1;
- }
-
- if ((rv = ap_mpm_pod_open(pconf, &pod))) {
- ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s,
- "Could not open pipe-of-death.");
- return 1;
- }
-
- ap_log_pid(pconf, ap_pid_fname);
-
/* Initialize cross-process accept lock */
ap_lock_fname = apr_psprintf(_pconf, "%s.%" APR_OS_PROC_T_FMT,
ap_server_root_relative(_pconf, ap_lock_fname),
return 0;
}
+/* This really should be a post_config hook, but the error log is already
+ * redirected by that point, so we need to do this in the open_logs phase.
+ */
+static int worker_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
+{
+ apr_status_t rv;
+
+ pconf = p;
+ ap_server_conf = s;
+
+ if ((num_listensocks = ap_setup_listeners(ap_server_conf)) < 1) {
+ ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ALERT|APLOG_STARTUP, 0,
+ NULL, "no listening sockets available, shutting down");
+ return DONE;
+ }
+
+ if ((rv = ap_mpm_pod_open(pconf, &pod))) {
+ ap_log_error(APLOG_MARK, APLOG_CRIT|APLOG_STARTUP, rv, NULL,
+ "Could not open pipe-of-death.");
+ return DONE;
+ }
+ return OK;
+}
+
static int worker_pre_config(apr_pool_t *pconf, apr_pool_t *plog,
apr_pool_t *ptemp)
{
static void worker_hooks(apr_pool_t *p)
{
+ /* The worker open_logs phase must run before the core's, or stderr
+ * will be redirected to a file, and the messages won't print to the
+ * console.
+ */
+ static const char *const aszSucc[] = {"core.c", NULL};
one_process = 0;
+ ap_hook_open_logs(worker_open_logs, NULL, aszSucc, APR_HOOK_MIDDLE);
ap_hook_pre_config(worker_pre_config, NULL, NULL, APR_HOOK_MIDDLE);
}