feat(legacy): disable services check when missing systemctl (#2160)
This commit is contained in:
parent
74539f75d8
commit
1edcbc0657
|
@ -45,6 +45,11 @@ function checkDatabaseDependencies()
|
||||||
&& in_array('pgsql', $extensions);
|
&& 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
|
* Check that all external services are configured correctly and return an associative
|
||||||
* array with the results.
|
* array with the results.
|
||||||
|
@ -53,15 +58,20 @@ function checkDatabaseDependencies()
|
||||||
*/
|
*/
|
||||||
function checkExternalServices()
|
function checkExternalServices()
|
||||||
{
|
{
|
||||||
return [
|
$result = [
|
||||||
'database' => checkDatabaseConfiguration(),
|
'database' => checkDatabaseConfiguration(),
|
||||||
'analyzer' => checkAnalyzerService(),
|
|
||||||
'pypo' => checkPlayoutService(),
|
|
||||||
'liquidsoap' => checkLiquidsoapService(),
|
|
||||||
'rabbitmq' => checkRMQConnection(),
|
'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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -15,12 +15,15 @@ $postgres = $phpDependencies['postgres'];
|
||||||
|
|
||||||
$database = $externalServices['database'];
|
$database = $externalServices['database'];
|
||||||
$rabbitmq = $externalServices['rabbitmq'];
|
$rabbitmq = $externalServices['rabbitmq'];
|
||||||
|
$systemd = with_systemd();
|
||||||
|
|
||||||
|
if ($systemd) {
|
||||||
$pypo = $externalServices['pypo'];
|
$pypo = $externalServices['pypo'];
|
||||||
$liquidsoap = $externalServices['liquidsoap'];
|
$liquidsoap = $externalServices['liquidsoap'];
|
||||||
$analyzer = $externalServices['analyzer'];
|
$analyzer = $externalServices['analyzer'];
|
||||||
$celery = $externalServices['celery'];
|
$celery = $externalServices['celery'];
|
||||||
$api = $externalServices['api'];
|
$api = $externalServices['api'];
|
||||||
|
}
|
||||||
|
|
||||||
$r1 = array_reduce($phpDependencies, 'booleanReduce', true);
|
$r1 = array_reduce($phpDependencies, 'booleanReduce', true);
|
||||||
$r2 = array_reduce($externalServices, 'booleanReduce', true);
|
$r2 = array_reduce($externalServices, 'booleanReduce', true);
|
||||||
|
@ -155,6 +158,7 @@ $result = $r1 && $r2;
|
||||||
</td>
|
</td>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php if ($systemd) { ?>
|
||||||
<tr class="<?php echo $analyzer ? 'success' : 'danger'; ?>">
|
<tr class="<?php echo $analyzer ? 'success' : 'danger'; ?>">
|
||||||
<td class="component">
|
<td class="component">
|
||||||
Media Analyzer
|
Media Analyzer
|
||||||
|
@ -250,6 +254,7 @@ $result = $r1 && $r2;
|
||||||
</td>
|
</td>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php } ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -10,11 +10,14 @@ $postgres = $phpDependencies["postgres"];
|
||||||
$database = $externalServices["database"];
|
$database = $externalServices["database"];
|
||||||
$rabbitmq = $externalServices["rabbitmq"];
|
$rabbitmq = $externalServices["rabbitmq"];
|
||||||
|
|
||||||
$pypo = $externalServices["pypo"];
|
$systemd = with_systemd();
|
||||||
$liquidsoap = $externalServices["liquidsoap"];
|
if ($systemd) {
|
||||||
$analyzer = $externalServices["analyzer"];
|
$pypo = $externalServices['pypo'];
|
||||||
|
$liquidsoap = $externalServices['liquidsoap'];
|
||||||
|
$analyzer = $externalServices['analyzer'];
|
||||||
$celery = $externalServices['celery'];
|
$celery = $externalServices['celery'];
|
||||||
$api = $externalServices['api'];
|
$api = $externalServices['api'];
|
||||||
|
}
|
||||||
|
|
||||||
$r1 = array_reduce($phpDependencies, "booleanReduce", true);
|
$r1 = array_reduce($phpDependencies, "booleanReduce", true);
|
||||||
$r2 = array_reduce($externalServices, "booleanReduce", true);
|
$r2 = array_reduce($externalServices, "booleanReduce", true);
|
||||||
|
@ -94,6 +97,7 @@ $result = $r1 && $r2;
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php if ($systemd) { ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="component">
|
<td class="component">
|
||||||
Media Analyzer
|
Media Analyzer
|
||||||
|
@ -199,6 +203,7 @@ $result = $r1 && $r2;
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php } ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
<tr id="partitions" class="even">
|
<tr id="partitions" class="even">
|
||||||
<th colspan="5"><?php echo _("Disk Space") ?></th>
|
<th colspan="5"><?php echo _("Disk Space") ?></th>
|
||||||
|
|
Loading…
Reference in New Issue