serivce: need another type for command launcher

This commit is contained in:
Franco Fichtner 2016-02-20 12:54:44 +01:00
parent 4d3ac63ac3
commit 6f2daad533
2 changed files with 10 additions and 4 deletions

View File

@ -2702,6 +2702,9 @@ function services_get()
$services[] = array(
'description' => gettext('System Configuration Daemon'),
'pidfile' => '/var/run/configd.pid',
'mwexec' => array(
'start' => array('/usr/local/etc/rc.d/configd start'),
),
'name' => 'configd',
);

View File

@ -102,9 +102,15 @@ function service_control_start($name, $extras)
}
/* XXX fall through later */
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']) {
case 'radvd':
services_radvd_configure();
@ -149,9 +155,6 @@ function service_control_start($name, $extras)
case 'suricata':
configd_run("ids start");
break;
case 'configd':
mwexec('/usr/local/etc/rc.d/configd start');
break;
case 'captiveportal':
configd_run("captiveportal start");
break;