From 516f98dfcfc1164f9b6c7621bad15e0e476474d7 Mon Sep 17 00:00:00 2001 From: Lucas Bickel Date: Sat, 1 Apr 2017 10:25:12 +0200 Subject: [PATCH 1/2] Report on airtime-celery service in status Adds celery checks to /?config and /systemstatus for completeness' sake. Fixes #138 --- .../application/configs/config-check.php | 23 ++++++++++++++++++- .../views/scripts/systemstatus/index.phtml | 21 +++++++++++++++++ airtime_mvc/build/airtime-setup/load.php | 16 ++++++++++++- 3 files changed, 58 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/configs/config-check.php b/airtime_mvc/application/configs/config-check.php index f2b3666e5..5c6e010fd 100644 --- a/airtime_mvc/application/configs/config-check.php +++ b/airtime_mvc/application/configs/config-check.php @@ -16,7 +16,8 @@ $rabbitmq = $externalServices["rabbitmq"]; $pypo = $externalServices["pypo"]; $liquidsoap = $externalServices["liquidsoap"]; -$analyzer = $externalServices["analyzer"]; +$analyzer = $externalServices["analyzer"]; +$celery = $externalServices['celery']; $r1 = array_reduce($phpDependencies, "booleanReduce", true); $r2 = array_reduce($externalServices, "booleanReduce", true); @@ -221,6 +222,26 @@ $result = $r1 && $r2; ?> + + + Celery + + + Airtime Celery Task service + + + "> + Check that the airtime-celery service is installed correctly in /etc/init.d, + and ensure that it's running with +
initctl list | grep airtime-celery
+ If not, try running sudo service airtime-celery restart + + + diff --git a/airtime_mvc/application/views/scripts/systemstatus/index.phtml b/airtime_mvc/application/views/scripts/systemstatus/index.phtml index 9fa27d378..f86654e1e 100644 --- a/airtime_mvc/application/views/scripts/systemstatus/index.phtml +++ b/airtime_mvc/application/views/scripts/systemstatus/index.phtml @@ -13,6 +13,7 @@ $pypo = $externalServices["pypo"]; $liquidsoap = $externalServices["liquidsoap"]; $analyzer = $externalServices["analyzer"]; + $celery = $externalServices['celery']; $r1 = array_reduce($phpDependencies, "booleanReduce", true); $r2 = array_reduce($externalServices, "booleanReduce", true); @@ -149,6 +150,26 @@ ?> + + + Celery + + + LibreTime Celery Task service + + + "> + Check that the airtime-celery service is installed correctly in /etc/init, + and ensure that it's running with +
initctl list | grep airtime-celery
+ If not, try
sudo service airtime-celery restart + + + diff --git a/airtime_mvc/build/airtime-setup/load.php b/airtime_mvc/build/airtime-setup/load.php index 6b2624ce0..d255037ed 100644 --- a/airtime_mvc/build/airtime-setup/load.php +++ b/airtime_mvc/build/airtime-setup/load.php @@ -54,7 +54,8 @@ function checkExternalServices() { "analyzer" => checkAnalyzerService(), "pypo" => checkPlayoutService(), "liquidsoap" => checkLiquidsoapService(), - "rabbitmq" => checkRMQConnection() + "rabbitmq" => checkRMQConnection(), + "celery" => checkCeleryService(), ); } @@ -144,3 +145,16 @@ function checkLiquidsoapService() { } return $status == 0; } + +/** + * Check if airtime-celery is currently running + * + * @return boolean true if airtime-celery is running + */ +function checkCeleryService() { + exec("pgrep -f -u www-data airtime-celery", $out, $status); + if (array_key_exists(0, $out) && $status == 0) { + return posix_kill(rtrim($out[0]), 0); + } + return $status == 0; +} From 5fcd60415c57460529c323d3fa373be9ea33f8da Mon Sep 17 00:00:00 2001 From: Lucas Bickel Date: Fri, 7 Apr 2017 11:46:23 +0200 Subject: [PATCH 2/2] Change to check celery user instead of www-data --- airtime_mvc/build/airtime-setup/load.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/build/airtime-setup/load.php b/airtime_mvc/build/airtime-setup/load.php index d255037ed..5a49630f5 100644 --- a/airtime_mvc/build/airtime-setup/load.php +++ b/airtime_mvc/build/airtime-setup/load.php @@ -152,7 +152,7 @@ function checkLiquidsoapService() { * @return boolean true if airtime-celery is running */ function checkCeleryService() { - exec("pgrep -f -u www-data airtime-celery", $out, $status); + exec("pgrep -f -u celery airtime-celery", $out, $status); if (array_key_exists(0, $out) && $status == 0) { return posix_kill(rtrim($out[0]), 0); }