Commit 02956706 authored by Ad Schellevis's avatar Ad Schellevis

(services) add support for "non stoppable" services, configuration options...

(services) add support for "non stoppable" services, configuration options without status. needed for https://github.com/opnsense/core/issues/1217
parent a53938e4
......@@ -2713,6 +2713,8 @@ function get_service_status($service)
{
if (isset($service['pidfile'])) {
return isvalidpid($service['pidfile']);
} elseif (!empty($service['nocheck'])) {
return true;
}
return is_process_running($service['name']);
......@@ -2752,16 +2754,17 @@ function get_service_control_links($service, $addname = false)
'srv_status_act',
'glyphicon glyphicon-refresh'
);
$output .= sprintf(
$template,
$service_id,
'stop',
$service['name'],
sprintf(gettext('Stop %sService'), $service_title),
'srv_status_act',
'glyphicon glyphicon-stop'
);
if (empty($service['nocheck'])) {
$output .= sprintf(
$template,
$service_id,
'stop',
$service['name'],
sprintf(gettext('Stop %sService'), $service_title),
'srv_status_act',
'glyphicon glyphicon-stop'
);
}
} else {
$output .= sprintf(
$template,
......
......@@ -240,6 +240,8 @@ include("head.inc");
title="<?=sprintf(gettext('Restart %sService'), $service['name']);?>"
class="btn btn-xs btn-default xmlrpc_srv_status_act glyphicon glyphicon-refresh">
</span>
<?php
if (empty($service['nocheck'])):?>
<span
data-service_action="stop"
data-service_id="<?=!empty($service['id']) ? $service['id'] : "";?>"
......@@ -249,6 +251,7 @@ include("head.inc");
class="btn btn-xs btn-default xmlrpc_srv_status_act glyphicon glyphicon-stop">
</span>
<?php
endif;
else:?>
<span
data-service_action="start"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment