httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sander Temme <san...@temme.net>
Subject Re: Sample code for IPC in modules
Date Wed, 05 May 2004 06:51:26 GMT
Hi Mark,

Thanks for your observations.

On May 4, 2004, at 7:18 PM, mark wrote:

> Your attach logic should work, however it raises privilege issues 
> because the children run as a different user (nobody or www, etc) the 
> than the process running the create (root). I had problems when I was 
> doing it that way, worked

I have to admit I hadn't tested as root, and it does exhibit permission 
problems on linux and darwin as well. Omitting the attach solves that 
problem, and I also got reacquainted with 
unixd_set_global_mutex_perms(). So, both of those are working now.

> 2)
> Dettach is never needed. However, depending on desired results, it is 
> usually desireable to perform a destroy when a HUP signal is sent, so 
> that it gets created fresh by post_config
>
> I've run into the strange errors under high load where newly forked 
> children startup thinking they are attached to the inherited shm seg, 
> but are in fact attached to some anonymous new segment. No error is 
> produced, but obviously it's a catastrophic situation.

Yeah, that would be Bad. However, how does one hook into the SIGHUP 
handler? AFAIK, httpd has its own signal handlers that do stuff like 
restarts and graceful, and if I registered another handler, I would 
overrule the one that httpd sets. Or is there a provision for a chain 
of signal handlers?

I put the new version at <http://apache.org/~sctemme/mod_example_ipc.c> 
to save on e-mail bandwidth.

Thanks again,

S.

-- 
sander@temme.net              http://www.temme.net/sander/
PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF

Mime
View raw message