Created
November 9, 2021 05:45
-
-
Save adduc/d58a33c899cf078006b7f00291668477 to your computer and use it in GitHub Desktop.
stacktrace-on-sighup.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
pcntl_async_signals(true); | |
pcntl_signal(SIGHUP, function ($signal) { | |
echo "HUP! {$signal} \n"; | |
error_log((new Exception())->getTraceAsString()); | |
}); | |
(new class | |
{ | |
function __invoke() | |
{ | |
printf("kill -s HUP %d\n", getmypid()); | |
while (true) { | |
sleep(255); | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment