private function sendTERMSignal()
    {
        if (!$this->hasReceivedHUP) {
            $this->hasReceivedHUP = true;
            try {
                $this->process->signal(SIGTERM);
            } catch (\Symfony\Component\Process\Exception\LogicException $e) {
                //In case the process ends between checking and actually sending the signal
            }
        }
    }