posix_kill

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Send a signal to a process
posix_kill(int $process_idint $signal): bool
        $this->events->dispatch(new WorkerStopping($status));



        if (
extension_loaded('posix')) {

            
posix_kill(getmypid(), SIGKILL);

        }



        exit(
$status);
    public function kill(int $processIdint $signal)

    {

        return 
posix_kill($processId$signal);

    }

}
        });



        
$this->loop->futureTick(function () {

            
posix_kill(posix_getpid(), SIGUSR1);

        });



        
$this->loop->run();
        $this->loop->addSignal(SIGUSR1$func);



        
$this->loop->addTimer(0.4, function () {

            
posix_kill(posix_getpid(), SIGUSR1);

        });

        
$loop $this->loop;

        
$this->loop->addTimer(0.9, function () use (&$func$loop) {
        } else if ($childPid === 0) {


            
usleep(20000);

            
posix_kill($currentPidconstant($signal));

            die();

        }

    }
        echo "PHP-FPM seems to be running already. This might be because Lambda stopped the bootstrap process but didn't leave us an opportunity to stop PHP-FPM (did Lambda timeout?). Stopping PHP-FPM now to restart from a blank slate.\n";




        
$result posix_kill($pidself::SIGTERM);

        if (
$result === false) {

            echo 
"PHP-FPM's PID file contained a PID that doesn't exist, assuming PHP-FPM isn't running.\n";

            
unlink(self::SOCKET);