#!/usr/bin/env php
<?php
declare(ticks=1);
$pid = pcntl_fork();
if ($pid) {
exit;
}
cli_set_process_title('myProcess');
echo 'OK';
ps ax | grep myProcess
733814 pts/0 S 0:00 myProcess
register_shutdown_function(function () {
posix_kill(getmypid(), SIGKILL);
});