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()
$pconfig = array();
$pconfig['name'] = "apinger";
$pconfig['description'] = gettext("Gateway Monitoring Daemon");
$pconfig['php']['start'] = 'setup_gateways_monitor';
$services[] = $pconfig;
}
......@@ -2649,6 +2650,7 @@ function services_get()
$pconfig = array();
$pconfig['name'] = 'sshd';
$pconfig['description'] = gettext('Secure Shell Daemon');
$pconfig['configd']['start'] = 'sshd restart';
$services[] = $pconfig;
}
......
......@@ -90,6 +90,17 @@ function service_control_start($name, $extras)
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']) {
case 'radvd':
services_radvd_configure();
......@@ -97,9 +108,6 @@ function service_control_start($name, $extras)
case 'ntpd':
system_ntp_configure();
break;
case 'apinger':
setup_gateways_monitor();
break;
case 'bsnmpd':
services_snmpd_configure();
break;
......@@ -127,9 +135,6 @@ function service_control_start($name, $extras)
case 'ipsec':
vpn_ipsec_force_reload();
break;
case 'sshd':
configd_run("sshd restart");
break;
case 'relayd':
relayd_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