Fix rpc server signal handler
Fix signal handler check
pcntl check
manually merged after some nitpicking