code: func (process *TeleportProcess) collectStatuses() {
  	pids := process.getForkedPIDs()
  	if len(pids) == 0 {
  		return
  	}
  	for _, pid := range pids {
  		var wait syscall.WaitStatus
  		rpid, err := syscall.Wait4(pid, &wait, syscall.WNOHANG, nil)
  		if err != nil {
  			process.Errorf("Wait call failed: %v.", err)
  			continue
  		}
  		if rpid == pid {
  			process.popForkedPID(pid)
  			process.Warningf("Forked teleport process %v has exited with status: %v.", pid, wait.ExitStatus())
  		}
  	}
  }
docs: // collectStatuses attempts to collect exit statuses from
  // forked teleport child processes.
  // If forked teleport process exited with an error during graceful
  // restart, parent process has to collect the child process status
  // otherwise the child process will become a zombie process.
  // Call Wait4(-1) is trying to collect status of any child
  // leads to warnings in logs, because other parts of the program could
  // have tried to collect the status of this process.
  // Instead this logic tries to collect statuses of the processes
  // forked during restart procedure.