the parent receive SIGTERM from its child (httpd) ?

the parent is a process manager in our design, and httpd service is one of its child processes, which is started in foreground mode (with "-D FOREGROUND" options) according to our requirements.

when httpd service is started, one main httpd process and eight sub httpd processes can be found by "ps -ef | grep httpd". (the eight sub httpd processes are child processes of this main httpd process)

The problem is that:
-> if use "kill pid_of_httpd" to kill the main httpd process, its parent(the process manager) receives SIGTERM from it, but not SIGCHLD, which is unexpected.
-> if use "kill -9 pid_of_httpd" to kill the main httpd process, its parent receives SIGCHLD from it, which is expected.

Can anybody tell me why? Or is there any method to make httpd send SIGCHLD but not SIGTERM to its parent when killed by "kill pid_of_httpd"?

Thanks in advance !

I'm guessing with kill -9 you are not allowing it to run its regular signal handlers, which include sending a SIGTERM to the parent. I'm also guessing this is by design, and that you should be able to find an option which disables this behavior. Is this Apache httpd? Does the same thing happen if you leave out the -D FOREGROUND or use a different -D option? Can't you simply stop it with ctrl-C anyway?

Yes, it is Apache httpd.
Using "-D FOREGROUND" option is to run httpd as a child process of the process manager in our system, so that it can be monitored by the process manager. If leave out this option, when the process manager fork() and exec() to start httpd, it will became an orphan(which parent process pid is 1 ).
And the process manager is running in background mode, so Ctrl-C could not terminate the process manager and httpd service.
Kill httpd by "kill" command is just to test whether the process manager can be aware of its child process - httpd exiting.

Thanks for your advice, but by "

. ", it is the design of httpd, and we could hardly do nothing to change it, unless there is no other solution.
and by "

.", you mean the options to start httpd ?

Thanks !

Yes, that's what I'm suggesting. Quick googling seemed to indicate that there are other -D options which might work better for you.

Thanks a lot, era !

the option "-D NO_DETACH" can meet our requirements, and works fine~

more information can refer to:

Page 10 - Getting Started with Apache