<?php declare(ticks=1); $pid = pcntl_fork(); if ($pid == -1) { die("fork ã§ãã¾ãã"); } else if ($pid) { exit(); // 親ããã»ã¹ã®å ´å } else { // åããã»ã¹ã®å ´å } // å¶å¾¡å´ã®ç«¯æ«ãããã¿ãã if (posix_setsid() == -1) { die("could not detach from terminal"); } // ã·ã°ãã«ãã³ãã©ãè¨å® pcntl_signal(SIGTERM, "sig_handler"); pcntl_signal(SIGHUP, "sig_handler"); // ç¡éã«ã¼ãã§ã¿ã¹ã¯å®è¡ while (1) { // ä½ãé¢ç½ããã¨ãããã§è¡ã } function sig_handler($signo) { swit

{{#tags}}- {{label}}
{{/tags}}