code: public function stop($graceful = false)
      {
          if ($graceful)
              $this->logger->debug("application will graceful quit");
          else
              $this->logger->debug("application will quit");
          $this->quiting = true;
          $signal = $graceful ? SIGQUIT : SIGTERM;
          $limit = time() + 10;
  
          $this->killall($signal);
  
          while (time() < $limit) {
              $this->dispatch_signals();
              if (count($this->workers) == 0) {
                  break;
              }
              // 偶尔存在SIGCHLD 没有REAP到的进程
              $this->reap();
              usleep(100000);
          }
  
          if ($graceful)
              $this->killall(SIGKILL);
  
         $this->logger->debug("master process quit.");
         $this->willQuit();
         exit(0);
      }
docs: 停止所有进程并退出
  
  @param boolean $graceful
  @return void