Bug 50278 - -DFOREGROUND and ap_unixd_killpg()/ap_os_killpg()
Summary: -DFOREGROUND and ap_unixd_killpg()/ap_os_killpg()
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Core (show other bugs)
Version: 2.5-HEAD
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-16 02:32 UTC by Vyacheslav Ignatyuk
Modified: 2010-11-16 02:32 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vyacheslav Ignatyuk 2010-11-16 02:32:31 UTC
-DFOREGROUND mutes setsid() call so entire httpd processes collection (master + childs) inherites process group from the parent process which is usually some sort of supervisor process. Regardless of fact that https is NOT process group leader in given case httpd uses *_killpg() call[s] during cleanup stage what effectively kills entire process group httpd do not own. This is complete disaster and apache must not do this. httpd should check whether it is process group leader or not first. If not, it must not kill process group it belongs. Saying that I see no other way as to keep childs PIDs somewhere and kill them separately one by one.


In theory "httpd -DFOREGROUND -DNO_DETACH" should make apache run as well behaved application, but we see that this does not work at all. In some cases it can kill init and this is what must never happen.