改名
This commit is contained in:
@@ -6,6 +6,8 @@ namespace HttpServer;
|
|||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use Snowflake\Abstracts\Component;
|
use Snowflake\Abstracts\Component;
|
||||||
|
use Snowflake\Abstracts\Config;
|
||||||
|
use Snowflake\Exception\ConfigException;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -85,14 +87,15 @@ class Shutdown extends Component
|
|||||||
/**
|
/**
|
||||||
* @param $content
|
* @param $content
|
||||||
* @return bool
|
* @return bool
|
||||||
|
* @throws ConfigException
|
||||||
*/
|
*/
|
||||||
public function pidIsExists($content): bool
|
public function pidIsExists($content): bool
|
||||||
{
|
{
|
||||||
if (intval($content) < 1) {
|
if (intval($content) < 1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$shell = 'ps -eo pid,state | grep %d | grep -v grep';
|
$shell = 'ps -eo pid,state | grep %d | grep %s | grep -v grep';
|
||||||
exec(sprintf($shell, intval($content)), $output, $code);
|
exec(sprintf($shell, intval($content), Config::get('id')), $output, $code);
|
||||||
var_dump(sprintf($shell, intval($content)));
|
var_dump(sprintf($shell, intval($content)));
|
||||||
if (empty($output)) {
|
if (empty($output)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user