Check to see if posix_getsid exists
This commit is contained in:
parent
7d641711fc
commit
694fa611ef
|
|
@ -58,6 +58,7 @@
|
||||||
//check to see if the process is running
|
//check to see if the process is running
|
||||||
if (file_exists($file)) {
|
if (file_exists($file)) {
|
||||||
$pid = file_get_contents($file);
|
$pid = file_get_contents($file);
|
||||||
|
if (function_exists('posix_getsid')) {
|
||||||
if (posix_getsid($pid) === false) {
|
if (posix_getsid($pid) === false) {
|
||||||
//process is not running
|
//process is not running
|
||||||
$exists = false;
|
$exists = false;
|
||||||
|
|
@ -67,6 +68,17 @@
|
||||||
$exists = true;
|
$exists = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if (file_exists('/proc/'.$pid)) {
|
||||||
|
//process is running
|
||||||
|
$exists = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//process is not running
|
||||||
|
$exists = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//return the result
|
//return the result
|
||||||
return $exists;
|
return $exists;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue