Commit ebf076e1 authored by Franco Fichtner's avatar Franco Fichtner

serivce: need another type for command launcher

(cherry picked from commit 6f2daad5)
parent f54cf1cc
...@@ -2709,6 +2709,9 @@ function services_get() ...@@ -2709,6 +2709,9 @@ function services_get()
$services[] = array( $services[] = array(
'description' => gettext('System Configuration Daemon'), 'description' => gettext('System Configuration Daemon'),
'pidfile' => '/var/run/configd.pid', 'pidfile' => '/var/run/configd.pid',
'mwexec' => array(
'start' => array('/usr/local/etc/rc.d/configd start'),
),
'name' => 'configd', 'name' => 'configd',
); );
......
...@@ -102,9 +102,15 @@ function service_control_start($name, $extras) ...@@ -102,9 +102,15 @@ function service_control_start($name, $extras)
} }
/* XXX fall through later */ /* XXX fall through later */
return sprintf(gettext('%s has been started via php.'), htmlspecialchars($name)); return sprintf(gettext('%s has been started via php.'), htmlspecialchars($name));
} elseif (isset($service['mwexec']['start'])) {
foreach ($service['mwexec']['start'] as $cmd) {
mwexec($cmd);
}
/* XXX fall through later */
return sprintf(gettext('%s has been started via mwexec.'), htmlspecialchars($name));
} }
/* XXX migrate all of those */ /* XXX migrate all of those */
switch ($service['name']) { switch ($service['name']) {
case 'radvd': case 'radvd':
services_radvd_configure(); services_radvd_configure();
...@@ -149,9 +155,6 @@ function service_control_start($name, $extras) ...@@ -149,9 +155,6 @@ function service_control_start($name, $extras)
case 'suricata': case 'suricata':
configd_run("ids start"); configd_run("ids start");
break; break;
case 'configd':
mwexec('/usr/local/etc/rc.d/configd start');
break;
case 'captiveportal': case 'captiveportal':
configd_run("captiveportal start"); configd_run("captiveportal start");
break; break;
......
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