Commit 918df6ea authored by Franco Fichtner's avatar Franco Fichtner

services: finish rework by removing last custom glue

parent d03b53b3
......@@ -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
* adds appropriate static routes.
......
......@@ -2588,6 +2588,7 @@ function services_get()
$pconfig = array();
$pconfig['name'] = "apinger";
$pconfig['description'] = gettext("Gateway Monitoring Daemon");
$pconfig['php']['restart'] = array('setup_gateways_monitor_full');
$pconfig['php']['start'] = array('setup_gateways_monitor');
$pconfig['pidfile'] = '/var/run/apinger.pid';
$services[] = $pconfig;
......@@ -2668,6 +2669,7 @@ function services_get()
$pconfig = array();
$pconfig['name'] = "relayd";
$pconfig['description'] = gettext("Server load balancing daemon");
$pconfig['php']['restart'] = array('relayd_configure_full', 'filter_configure');
$pconfig['php']['start'] = array('relayd_configure', 'filter_configure');
$services[] = $pconfig;
}
......
......@@ -125,6 +125,10 @@ class SendMonitor extends Monitor {
}
}
function relady_configure_full()
{
relayd_configure(true);
}
function relayd_configure($kill_first = false)
{
......
......@@ -141,18 +141,8 @@ function service_control_restart($name, $extras)
{
$msg = sprintf(gettext("%s has been restarted."), htmlspecialchars($name));
/* XXX clean this up */
switch($name) {
case 'apinger':
killbypid("/var/run/apinger.pid");
setup_gateways_monitor();
return $msg;
case 'relayd':
relayd_configure(true);
filter_configure();
return $msg;
default:
break;
if ($name == 'openvpn') {
$filter['vpnid'] = $extras['id'];
}
$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