Dear List,

I have an Apache2 module that forks a new process when it first handles a request. Subsequent request-handling processes/threads communicate with this "back-end" process via shared memory. This generally works, but I am having trouble at termination. It seems that my backend process terminates when I'm using the "prefork" MPM, but not when I'm using "worker".

As far as I can see, in the "prefork" environment my process gets SIGTERM, which it handles (it needs to delete its shared memory segment) and then exits. In the "worker" environment it looks as if it doesn't get any signal and becomes an oprphan, with init as its parent. I find it odd that it gets SIGTERM - has Apache sent it? - normally it would get SIGHUP from the kernel when its process group leader terminates. I guess that Apache is trying to kill its children itself, rather than letting the kernel do it, and is behaving differently in the two MPMs. But I have not told Apache anything about this process - how did it find its pid?

Doe this makes any sense to anyone? I note that 2.1 has had some changes to shutdown; is this related?

This code is for Anyterm - http://anyterm.org/ - and you can see the code for the backend process at http://svn.anyterm.org/anyterm/trunk/apachemod/backend.cc. The relevant bits are at the end of the file.

I'm using 2.0.54 on Debian.

Sorry this is a bit vague. I'm just hoping someone will immediately recognise what's going wrong....

Cheers,

--Phil.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
  "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to