A deadlock has appeared when we send SIGTERM to ps
In the sig handler of ps main process, fprintf is used. However, the fprintf is not signal safety. In our server process, we use the ps command, and we need to test the process by sending SIGTERM. When the ps main process receives the signal SIGTERM during executing fprintf, the deadlock occurs. So please tell us what we should do when we encounter this problem? Can we only kill the ps process by sending signal 9?
Edited by N1hilarian