yes, there is really a pratical problem I want to fix...I'm sorry for my poor English that I did not express myself clearly with the word "illegal"...
what I meant is that in our system or according to our design requirements, there is a process(just like B in this example), its parent is A, and A will handle SIGCHLD from B. But we can only allow one process(C) to kill B, any other process killing B will be considered as an error case in A.
so we have to distinguish who kills this process B.
Actually, B here is ntpd service, we want to start it as A's child, let ntpd run in foreground mode. But if we re-configure ntpd, ntpd has to be restarted to reload the new configuration. So we allow C who has the privilege to re-configure ntpd to restart ntpd, but not other processes.
currently, I'd like to let C set a flag in /var/run/ntpd.pid file after re-configuration and before restart ntpd.
So I come here for help to see whether there is more smart ideas..
Thank you.