* [IPFire-SCM] [git.ipfire.org] IPFire 2.x development tree branch, master, updated. 24c82ed2128103912012cba5e5775e6873edf2ee
@ 2012-07-19 20:12 git
0 siblings, 0 replies; only message in thread
From: git @ 2012-07-19 20:12 UTC (permalink / raw)
To: ipfire-scm
[-- Attachment #1: Type: text/plain, Size: 2837 bytes --]
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".
The branch, master has been updated
via 24c82ed2128103912012cba5e5775e6873edf2ee (commit)
from a786b755eb828726c8db333b00865432933bcf24 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 24c82ed2128103912012cba5e5775e6873edf2ee
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date: Thu Jul 19 22:12:05 2012 +0200
services.cgi: Fix wrong memory usage display.
-----------------------------------------------------------------------
Summary of changes:
config/rootfiles/core/61/filelists/files | 1 +
html/cgi-bin/services.cgi | 17 +++++++++++------
2 files changed, 12 insertions(+), 6 deletions(-)
Difference in files:
diff --git a/config/rootfiles/core/61/filelists/files b/config/rootfiles/core/61/filelists/files
index 1466fef..6ef00dc 100644
--- a/config/rootfiles/core/61/filelists/files
+++ b/config/rootfiles/core/61/filelists/files
@@ -6,6 +6,7 @@ srv/web/ipfire/cgi-bin/index.cgi
srv/web/ipfire/cgi-bin/connections.cgi
srv/web/ipfire/cgi-bin/ovpnmain.cgi
srv/web/ipfire/cgi-bin/proxy.cgi
+srv/web/ipfire/cgi-bin/services.cgi
var/ipfire/general-functions.pl
var/ipfire/langs
var/ipfire/proxy/calamaris/bin/mkreport
diff --git a/html/cgi-bin/services.cgi b/html/cgi-bin/services.cgi
index 55740cf..123c325 100644
--- a/html/cgi-bin/services.cgi
+++ b/html/cgi-bin/services.cgi
@@ -240,7 +240,7 @@ sub isrunning{
my $pid = '';
my $testcmd = '';
my $exename;
- my @memory;
+ my $memory;
$cmd =~ /(^[a-z]+)/;
$exename = $1;
@@ -256,13 +256,18 @@ sub isrunning{
}
close FILE;
}
- if (open(FILE, "/proc/${pid}/statm")){
- my $temp = <FILE>;
- @memory = split(/ /,$temp);
+ if (open(FILE, "/proc/${pid}/status")) {
+ while (<FILE>) {
+ my ($key, $val) = split(":", $_, 2);
+ if ($key eq 'VmRSS') {
+ $memory = $val;
+ last;
+ }
+ }
+ close(FILE);
}
- close FILE;
if ($testcmd =~ /$exename/){
- $status = "<td align='center' bgcolor='${Header::colourgreen}'><font color='white'><b>$Lang::tr{'running'}</b></font></td><td align='center'>$pid</td><td align='center'>$memory[0] KB</td>";
+ $status = "<td align='center' bgcolor='${Header::colourgreen}'><font color='white'><b>$Lang::tr{'running'}</b></font></td><td align='center'>$pid</td><td align='center'>$memory</td>";
}
}
return $status;
hooks/post-receive
--
IPFire 2.x development tree
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-07-19 20:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-19 20:12 [IPFire-SCM] [git.ipfire.org] IPFire 2.x development tree branch, master, updated. 24c82ed2128103912012cba5e5775e6873edf2ee git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox