Commit 34bcc05b authored by Franco Fichtner's avatar Franco Fichtner

services: tracer code for start logic into service array

(cherry picked from commit 77696bd8)
parent fe2aa283
...@@ -2613,6 +2613,7 @@ function services_get() ...@@ -2613,6 +2613,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']['start'] = 'setup_gateways_monitor';
$services[] = $pconfig; $services[] = $pconfig;
} }
...@@ -2649,6 +2650,7 @@ function services_get() ...@@ -2649,6 +2650,7 @@ function services_get()
$pconfig = array(); $pconfig = array();
$pconfig['name'] = 'sshd'; $pconfig['name'] = 'sshd';
$pconfig['description'] = gettext('Secure Shell Daemon'); $pconfig['description'] = gettext('Secure Shell Daemon');
$pconfig['configd']['start'] = 'sshd restart';
$services[] = $pconfig; $services[] = $pconfig;
} }
......
...@@ -90,6 +90,17 @@ function service_control_start($name, $extras) ...@@ -90,6 +90,17 @@ function service_control_start($name, $extras)
return sprintf(gettext("Could not start unknown service `%s'"), htmlspecialchars($name)); return sprintf(gettext("Could not start unknown service `%s'"), htmlspecialchars($name));
} }
if (isset($service['configd']['start'])) {
configd_run($service['configd']['start']);
/* XXX fall through later */
return sprintf(gettext('%s has been started via configd.'), htmlspecialchars($name));
} elseif (isset($service['php']['start'])) {
$service['php']['start']();
/* XXX fall through later */
return sprintf(gettext('%s has been started via php.'), htmlspecialchars($name));
}
/* XXX migrate all of those */
switch ($service['name']) { switch ($service['name']) {
case 'radvd': case 'radvd':
services_radvd_configure(); services_radvd_configure();
...@@ -97,9 +108,6 @@ function service_control_start($name, $extras) ...@@ -97,9 +108,6 @@ function service_control_start($name, $extras)
case 'ntpd': case 'ntpd':
system_ntp_configure(); system_ntp_configure();
break; break;
case 'apinger':
setup_gateways_monitor();
break;
case 'bsnmpd': case 'bsnmpd':
services_snmpd_configure(); services_snmpd_configure();
break; break;
...@@ -127,9 +135,6 @@ function service_control_start($name, $extras) ...@@ -127,9 +135,6 @@ function service_control_start($name, $extras)
case 'ipsec': case 'ipsec':
vpn_ipsec_force_reload(); vpn_ipsec_force_reload();
break; break;
case 'sshd':
configd_run("sshd restart");
break;
case 'relayd': case 'relayd':
relayd_configure(); relayd_configure();
filter_configure(); filter_configure();
......
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