should this have a way of erroring out in case reaponeprocess constantly returns true i guess you are calling waitpid with wnohang and returning false in that case  you cannot always get and kill a process and never end  unless the system is in the middle of something like a fork bomb  i guess maybe in that case we do not care what happens 