Hi,
I have noted it isn't possible to have a directive failing and something
in the log once you fail in the second pass of the directive. See
attached sources (to build & install bin/apxs -i -a -c mod_test.c
)
I can see the debug and warning in the first pass (output to the
console) but nothing in the second pass not even the ""A second pass
error." error and it looks like httpd stops without error message...
Using strace I can see the following:
+++
20943 write(2, "AH00526: Syntax error on line 11"..., 81) = 81
20943 write(2, "A second pass error.\n", 21) = 21
20943 select(0, NULL, NULL, NULL, {0, 10000}) = 0 (Timeout)
20943 close(11) = 0
+++
Any way to get that in the error_log?
It is annoying for people developing their own modules because httpd
seems to stop without any reasons...
Cheers
Jean-Frederic
#include <httpd.h>
#include <http_config.h>
#include <http_log.h>
static const char * intoTheVoid(cmd_parms *parms, void *CFG)
{
void * pass = NULL;
apr_pool_userdata_get( & pass, "key", parms->server->process->pool );
ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, APLOGNO(11111) "Test: foobar");
ap_log_error(APLOG_MARK, APLOG_WARNING, 0, parms->server, APLOGNO(11111) "Test: foobar");
if (NULL == pass) {
apr_pool_userdata_set((void *) 0x1, "key", NULL, parms->server->process->pool);
} else {
ap_log_error(APLOG_MARK, APLOG_WARNING, 0, parms->server, APLOGNO(11111) "Test: foobar failed!!!");
return "A second pass error.";
}
return NULL;
}
static const command_rec itv_directives[] =
{
AP_INIT_NO_ARGS( "IntoTheVoid",
intoTheVoid,
NULL, ACCESS_CONF | RSRC_CONF,
"intothevoid description" ),
{ NULL }
};
AP_DECLARE_MODULE( intothevoid ) =
{
STANDARD20_MODULE_STUFF,
NULL,
NULL,
NULL,
NULL,
itv_directives,
NULL
};