in reply to Hold on the child under parent

Isn't the setsid() supposed to explicitely _prevent_ the behaviour you want? One of the properties of a daemon is that it won't die when the shell that started it exits.

So I believe that if you just remove your setsid() call your child will die when the parent does.