Commit f2e01de2 authored by Franco Fichtner's avatar Franco Fichtner

services: finish rework by removing last custom glue

(cherry picked from commit 918df6ea)
parent 4dfd446b
...@@ -42,6 +42,12 @@ function return_apinger_defaults() ...@@ -42,6 +42,12 @@ function return_apinger_defaults()
); );
} }
function setup_gateways_monitor_full()
{
killbypid('/var/run/apinger.pid');
setup_gateways_monitor();
}
/* /*
* Creates monitoring configuration file and * Creates monitoring configuration file and
* adds appropriate static routes. * adds appropriate static routes.
......
...@@ -2595,6 +2595,7 @@ function services_get() ...@@ -2595,6 +2595,7 @@ function services_get()
$pconfig = array(); $pconfig = array();
$pconfig['name'] = "apinger"; $pconfig['name'] = "apinger";
$pconfig['description'] = gettext("Gateway Monitoring Daemon"); $pconfig['description'] = gettext("Gateway Monitoring Daemon");
$pconfig['php']['restart'] = array('setup_gateways_monitor_full');
$pconfig['php']['start'] = array('setup_gateways_monitor'); $pconfig['php']['start'] = array('setup_gateways_monitor');
$pconfig['pidfile'] = '/var/run/apinger.pid'; $pconfig['pidfile'] = '/var/run/apinger.pid';
$services[] = $pconfig; $services[] = $pconfig;
...@@ -2675,6 +2676,7 @@ function services_get() ...@@ -2675,6 +2676,7 @@ function services_get()
$pconfig = array(); $pconfig = array();
$pconfig['name'] = "relayd"; $pconfig['name'] = "relayd";
$pconfig['description'] = gettext("Server load balancing daemon"); $pconfig['description'] = gettext("Server load balancing daemon");
$pconfig['php']['restart'] = array('relayd_configure_full', 'filter_configure');
$pconfig['php']['start'] = array('relayd_configure', 'filter_configure'); $pconfig['php']['start'] = array('relayd_configure', 'filter_configure');
$services[] = $pconfig; $services[] = $pconfig;
} }
......
...@@ -125,6 +125,10 @@ class SendMonitor extends Monitor { ...@@ -125,6 +125,10 @@ class SendMonitor extends Monitor {
} }
} }
function relady_configure_full()
{
relayd_configure(true);
}
function relayd_configure($kill_first = false) function relayd_configure($kill_first = false)
{ {
......
...@@ -141,18 +141,8 @@ function service_control_restart($name, $extras) ...@@ -141,18 +141,8 @@ function service_control_restart($name, $extras)
{ {
$msg = sprintf(gettext("%s has been restarted."), htmlspecialchars($name)); $msg = sprintf(gettext("%s has been restarted."), htmlspecialchars($name));
/* XXX clean this up */ if ($name == 'openvpn') {
switch($name) { $filter['vpnid'] = $extras['id'];
case 'apinger':
killbypid("/var/run/apinger.pid");
setup_gateways_monitor();
return $msg;
case 'relayd':
relayd_configure(true);
filter_configure();
return $msg;
default:
break;
} }
$service = find_service_by_name($name); $service = find_service_by_name($name);
......
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