httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Holsman <li...@holsman.net>
Subject Re: make the server not to start in case the Initialization is a failure
Date Fri, 10 Sep 2004 23:37:10 GMT
siba.dora@wipro.com wrote:
> Hi All,
> 
> I am trying to write a sample Plugin on APACHE 2.0 which does some
> initialization.
> 
> I am attaching the code portion for the same.
> 
> static void mod_register_hooks(apr_pool_t *p)
> {
>     ap_hook_child_init    (mod_init_Child, NULL,NULL, APR_HOOK_FIRST);
>     ap_hook_check_user_id (mod_auth,NULL,NULL, APR_HOOK_FIRST);
> 
> }
> 
> module AP_MODULE_DECLARE_DATA sm_mod_auth = {
>     STANDARD20_MODULE_STUFF,
>     NULL,   /* create per-dir    config structures */
>     NULL,    /* merge  per-dir    config structures */
>     NULL,   /* create per-server config structures */
>     NULL,    /* merge  per-server config structures */
>     NULL,            /* table of configuration directives   */
>     mod_register_hooks          /* register hooks */
> };
> 
> 
> 
> static int mod_init_Child(server_rec* pServerRec, apr_pool_t* pPool)
> {
> 	  int nRet = FALSE;
>         printf("Inside Child Auth Module\n");
> 	  nRet = InitConfigFile(pPool);
> 	  if (nRet == FALSE)
> 	      return FALSE;
> 	  else
> 		return TRUE;
> }
> 
> 
> How do make the server not to start in case the Initialization is a
> failure.
> The same used to work on apache 1.3x in case I returned exit(2), but its
> not working with apache 2.0.
> 
> Any help ???
> 

can you init the config file in a post-config hook instead of the child?
that can cause the apache to not start.

FWIW.. you haven't considered the case where init-child is executed on a 
running server for a new-process. would you like the entire server to 
fail because it couldn't spawn a new process for example? (even though 
the other children are quite happily serving requests)

> Thanks in advance
> 
> 
Ian
> 
> Confidentiality Notice
> 
> The information contained in this electronic message and any attachments to this message
are intended
> for the exclusive use of the addressee(s) and may contain confidential or privileged
information. If
> you are not the intended recipient, please notify the sender at Wipro or Mailadmin@wipro.com
immediately
> and destroy all copies of this message and any attachments.
> 


Mime
View raw message