mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 19:53:56 +00:00
Use /proc/$pid if posix_getsid is undefined
This commit is contained in:
@@ -58,15 +58,27 @@
|
|||||||
$exists = false;
|
$exists = false;
|
||||||
|
|
||||||
//check to see if the process is running
|
//check to see if the process is running
|
||||||
if (function_exists(posix_getsid) && file_exists($file)) {
|
if (file_exists($file)) {
|
||||||
$pid = file_get_contents($file);
|
$pid = file_get_contents($file);
|
||||||
if (posix_getsid($pid) === false) {
|
if (function_exists(posix_getsid)) {
|
||||||
//process is not running
|
if (posix_getsid($pid) === false) {
|
||||||
$exists = false;
|
//process is not running
|
||||||
|
$exists = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//process is running
|
||||||
|
$exists = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//process is running
|
if (file_exists('/proc/'.$pid)) {
|
||||||
$exists = true;
|
//process is running
|
||||||
|
$exists = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//process is not running
|
||||||
|
$exists = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user