summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-08-31 19:23:11 +0000
committerErmal <eri@pfsense.org>2010-08-31 19:23:11 +0000
commit9eda72592e6b4e92ed35d5382683c576395d4c62 (patch)
treedd370fd2b15921064d0fd6d83df53c62a3458fbe
parent319cbd5eb8d53678f6064b5b090a93012b0b4ecf (diff)
downloadpfsense-9eda72592e6b4e92ed35d5382683c576395d4c62.zip
pfsense-9eda72592e6b4e92ed35d5382683c576395d4c62.tar.gz
More fixes to status services.
-rwxr-xr-xusr/local/www/status_services.php13
-rw-r--r--usr/local/www/widgets/widgets/services_status.widget.php2
2 files changed, 6 insertions, 9 deletions
diff --git a/usr/local/www/status_services.php b/usr/local/www/status_services.php
index 530a346..ff84161 100755
--- a/usr/local/www/status_services.php
+++ b/usr/local/www/status_services.php
@@ -228,13 +228,10 @@ include("fbegin.inc");
<?php
-exec("/bin/ps ax | awk '{ print $5 }'", $psout);
-array_shift($psout);
-foreach($psout as $line) {
- $ps[] = trim(array_pop(explode(' ', array_pop(explode('/', $line)))));
-}
-
-$services = $config['installedpackages']['service'];
+if (is_array($config['installedpackages']['service']))
+ $services = $config['installedpackages']['service'];
+else
+ $services = array();
/* Add services that are in the base.
*
@@ -342,7 +339,7 @@ if (count($services) > 0) {
if ($service['name'] == "openvpn") {
$running = is_pid_running("{$g['varrun_path']}/openvpn_{$service['mode']}{$service['vpnid']}.pid");
} else {
- $running = (is_service_running($service['name'], $ps) || is_process_running($service['name']) );
+ $running = is_service_running($service['name']);
}
if($running) {
echo '<td class="listr"><center>';
diff --git a/usr/local/www/widgets/widgets/services_status.widget.php b/usr/local/www/widgets/widgets/services_status.widget.php
index 11d448e..11b3dce 100644
--- a/usr/local/www/widgets/widgets/services_status.widget.php
+++ b/usr/local/www/widgets/widgets/services_status.widget.php
@@ -175,7 +175,7 @@ if($services) {
if(!$service['description']) $service['description'] = get_pkg_descr($service['name']);
echo '<tr><td class="listlr">' . $service['name'] . "</td>\n";
echo '<td class="listr">' . substr($service['description'],0 ,20) . "</td>\n";
- if(is_service_running($service['name'], $ps) or is_process_running($service['name']) ) {
+ if(is_service_running($service['name'])) {
echo '<td class="listr"><center>';
echo "<img src=\"/themes/" . $g["theme"] . "/images/icons/icon_pass.gif\"> Running</td>\n";
$running = true;
OpenPOWER on IntegriCloud