From 52b06b5afc5cda3e4e2266a8f1c0adec6638069f Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 30 Aug 2022 14:45:09 -0600 Subject: [PATCH] Use /proc/$pid if posix_getsid is undefined --- .../resources/service/email_queue.php | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/app/email_queue/resources/service/email_queue.php b/app/email_queue/resources/service/email_queue.php index 7922501b0a..aa032a0d2f 100644 --- a/app/email_queue/resources/service/email_queue.php +++ b/app/email_queue/resources/service/email_queue.php @@ -58,15 +58,27 @@ $exists = false; //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); - if (posix_getsid($pid) === false) { - //process is not running - $exists = false; + if (function_exists(posix_getsid)) { + if (posix_getsid($pid) === false) { + //process is not running + $exists = false; + } + else { + //process is running + $exists = true; + } } else { - //process is running - $exists = true; + if (file_exists('/proc/'.$pid)) { + //process is running + $exists = true; + } + else { + //process is not running + $exists = false; + } } }