uid pid ppid stime tty : pts/ : pts/ : pts/ : pts/ time cmd : : python fork-server py : : [python : : ps - : : -bash in factif you type fast enoughyou can actually see child process morph from real running program into zombie herefor examplea child spawned to handle new request changes to on exit its connection cleans up lingering zombiesand its own process entry will be removed completely when the next request is received]server connected by ( ' at sun apr : : ps - uid pid ppid stime tty time cmd : pts/ : : python fork-server py : pts/ : : python fork-server py : pts/ : : ps - : pts/ : : -bash ]ps - uid pid ppid stime tty time cmd : pts/ : : python fork-server py : pts/ : : [python : pts/ : : ps - : pts/ : : -bash preventing zombies with signal handlers on linux on some systemsit' also possible to clean up zombie child processes by resetting the signal handler for the sigchld signal delivered to parent process by the operating system when child process stops or exits if python script assigns the sig_ign (ignoreaction as the sigchld signal handlerzombies will be removed automatically and immediately by the operating system as child processes exitthe parent need not issue wait calls to clean up after them because of thatthis scheme is simpler alternative to manually reaping zombies on platforms where it is supported if you've already read you know that python' standard signal module lets scripts install handlers for signals--software-generated events by way of reviewhere is brief bit of background to show how this pans out for zombies the program in example - installs python-coded signal handler function to respond to whatever signal number you type on the command line example - pp \internet\sockets\signal-demo py ""demo python' signal modulepass signal number as command-line argand use "kill - pidshell command to send this process signalon my linux machinesigusr = sigusr = sigchld= and sigchld handler stays in effect even if not restoredall other handlers are restored by python after caughtbut sigchld behavior is left to the platform' implementationsignal works on windows toobut defines only few signal typessignals are not very portable in generalhandling multiple clients