diff --git a/legacy/application/check.php b/legacy/application/check.php index 896171a03..1e39b3ae6 100644 --- a/legacy/application/check.php +++ b/legacy/application/check.php @@ -45,6 +45,11 @@ function checkDatabaseDependencies() && in_array('pgsql', $extensions); } +function with_systemd() +{ + return !empty(shell_exec('which systemctl')); +} + /** * Check that all external services are configured correctly and return an associative * array with the results. @@ -53,15 +58,20 @@ function checkDatabaseDependencies() */ function checkExternalServices() { - return [ + $result = [ 'database' => checkDatabaseConfiguration(), - 'analyzer' => checkAnalyzerService(), - 'pypo' => checkPlayoutService(), - 'liquidsoap' => checkLiquidsoapService(), 'rabbitmq' => checkRMQConnection(), - 'celery' => checkCeleryService(), - 'api' => checkApiService(), ]; + + if (with_systemd()) { + $result['analyzer'] = checkAnalyzerService(); + $result['pypo'] = checkPlayoutService(); + $result['liquidsoap'] = checkLiquidsoapService(); + $result['celery'] = checkCeleryService(); + $result['api'] = checkApiService(); + } + + return $result; } /** diff --git a/legacy/application/configs/config-check.php b/legacy/application/configs/config-check.php index 85e30e191..d0cbaa253 100644 --- a/legacy/application/configs/config-check.php +++ b/legacy/application/configs/config-check.php @@ -15,12 +15,15 @@ $postgres = $phpDependencies['postgres']; $database = $externalServices['database']; $rabbitmq = $externalServices['rabbitmq']; +$systemd = with_systemd(); -$pypo = $externalServices['pypo']; -$liquidsoap = $externalServices['liquidsoap']; -$analyzer = $externalServices['analyzer']; -$celery = $externalServices['celery']; -$api = $externalServices['api']; +if ($systemd) { + $pypo = $externalServices['pypo']; + $liquidsoap = $externalServices['liquidsoap']; + $analyzer = $externalServices['analyzer']; + $celery = $externalServices['celery']; + $api = $externalServices['api']; +} $r1 = array_reduce($phpDependencies, 'booleanReduce', true); $r2 = array_reduce($externalServices, 'booleanReduce', true); @@ -155,101 +158,103 @@ $result = $r1 && $r2; -
/etc/systemd/system/,
-
- systemctl status libretime-analyzersudo systemctl restart libretime-analyzer
+
+ /etc/systemd/system/,
-
- systemctl status libretime-playoutsudo systemctl restart libretime-playout
+ /etc/systemd/system/,
-
- systemctl status libretime-liquidsoapsudo systemctl restart libretime-liquidsoap
- /etc/systemd/system/,
+
+ systemctl status libretime-analyzersudo systemctl restart libretime-analyzer
+ /etc/systemd/system/,
-
- systemctl status libretime-workersudo systemctl restart libretime-worker
+ /etc/systemd/system/,
+
+ systemctl status libretime-playoutsudo systemctl restart libretime-playout
+ /etc/init.d/,
-
- systemctl status libretime-apisudo systemctl restart libretime-api
+
+ /etc/systemd/system/,
+
+ systemctl status libretime-liquidsoapsudo systemctl restart libretime-liquidsoap
+ /etc/systemd/system/,
+
+ systemctl status libretime-workersudo systemctl restart libretime-worker
+ /etc/init.d/,
+
+ systemctl status libretime-apisudo systemctl restart libretime-api
+ /etc/systemd/system/,
+
+ systemctl status libretime-analyzersudo systemctl restart libretime-analyzer
">
- /etc/systemd/system/,
-
- systemctl status libretime-analyzersudo systemctl restart libretime-analyzer
-
- /etc/systemd/system/,
+
+ systemctl status libretime-playoutsudo systemctl restart libretime-playout
">
- /etc/systemd/system/,
-
- systemctl status libretime-playoutsudo systemctl restart libretime-playout
-
- /etc/systemd/system/,
+
+ systemctl status libretime-liquidsoapsudo systemctl restart libretime-liquidsoap
">
- /etc/systemd/system/,
-
- systemctl status libretime-liquidsoapsudo systemctl restart libretime-liquidsoap
-
- /etc/systemd/system/,
+
+ systemctl status libretime-workersudo systemctl restart libretime-worker
">
- /etc/systemd/system/,
-
- systemctl status libretime-workersudo systemctl restart libretime-worker
-
- /etc/systemd/system/,
+
+ systemctl status libretime-apisudo systemctl restart libretime-api
">
- /etc/systemd/system/,
-
- systemctl status libretime-apisudo systemctl restart libretime-api
-
-