Commit 4ae8fc6c authored by Ad Schellevis's avatar Ad Schellevis

(legacy) add configd to status_services.php page, closes...

(legacy) add configd to status_services.php page, closes https://github.com/opnsense/core/issues/754
parent 8a13c8a7
...@@ -2680,6 +2680,9 @@ function get_services() { ...@@ -2680,6 +2680,9 @@ function get_services() {
if (isset($config['OPNsense']['IDS']['general']['enabled']) && $config['OPNsense']['IDS']['general']['enabled'] == 1) { if (isset($config['OPNsense']['IDS']['general']['enabled']) && $config['OPNsense']['IDS']['general']['enabled'] == 1) {
$services[] = array('name'=>'suricata', 'description' => gettext("Intrusion Detection")); $services[] = array('name'=>'suricata', 'description' => gettext("Intrusion Detection"));
} }
$services[] = array('name'=>'configd', 'description' => gettext("System Configuration Daemon"));
return $services; return $services;
} }
...@@ -2718,6 +2721,9 @@ function get_service_status($service) ...@@ -2718,6 +2721,9 @@ function get_service_status($service)
case 'ntpd': case 'ntpd':
$running = isvalidpid('/var/run/ntpd.pid'); $running = isvalidpid('/var/run/ntpd.pid');
break; break;
case 'configd':
$running = isvalidpid('/var/run/configd.pid');
break;
default: default:
$running = is_process_running($service['name']); $running = is_process_running($service['name']);
break; break;
......
...@@ -125,6 +125,9 @@ function service_control_start($name, $extras) { ...@@ -125,6 +125,9 @@ 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;
default: default:
log_error(sprintf(gettext("Could not start unknown service `%s'"), $name)); log_error(sprintf(gettext("Could not start unknown service `%s'"), $name));
break; break;
...@@ -194,6 +197,9 @@ function service_control_stop($name, $extras) { ...@@ -194,6 +197,9 @@ function service_control_stop($name, $extras) {
case 'suricata': case 'suricata':
configd_run("ids stop"); configd_run("ids stop");
break; break;
case 'configd':
killbypid("/var/run/configd.pid");
break;
default: default:
log_error(sprintf(gettext("Could not stop unknown service `%s'"), $name)); log_error(sprintf(gettext("Could not stop unknown service `%s'"), $name));
break; break;
...@@ -263,6 +269,9 @@ function service_control_restart($name, $extras) { ...@@ -263,6 +269,9 @@ function service_control_restart($name, $extras) {
case 'suricata': case 'suricata':
configd_run("ids restart"); configd_run("ids restart");
break; break;
case 'configd':
mwexec('/usr/local/etc/rc.d/configd restart');
break;
default: default:
log_error(sprintf(gettext("Could not restart unknown service `%s'"), $name)); log_error(sprintf(gettext("Could not restart unknown service `%s'"), $name));
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