public static function kill() { Octave_pool::killAll(); if (self::$child_process) { exit; } while (self::$child_pids) { // Waiting for all the children to die while (-1 != ($pid = pcntl_waitpid(-1, $status))) { self::manageDeadPID($pid); } if (self::$child_pids) { usleep(100); } } self::closeServerSockets(); Octave_logger::log("Service stopped"); exit; }