What I want to do is following: one parent process is creating lisening server process. This parent is forking a child which is "log maintainer" - it logs all the activity of parent/child processes into file and maintains that file size. Log maintainer (child process) is active all the time. What I want to complish is when I kill parent I want child to die instantly as well. I do not want to kill 2 processes in order to shut the functionality. Now I did this by means of two techniques:
1. child periodically checks if parentpid exists. If there is no parent pid it exists ; or
2. When parent is killed with INT signal - there is a signal handler for upon receiving the INT - it will kill child and then parent.
Those aproaches are with flaws:
1. I want child instantly killed when parent is killled and not to check periodicly!
2. What if parent is killed by other means than INT signal?
-Dejan.