X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=html%2Fcgi-bin%2Fservices.cgi;h=22a9ac707cce13d072c261398fae6c9ed8a25234;hb=d7a3254acedb43995d6a6e769562576cc7ff8639;hp=58d0a1dbcf23e31a432417a32c325585bbbddd19;hpb=14356fb908fd6062e987d61cc4c85a618e2fc180;p=ipfire-2.x.git diff --git a/html/cgi-bin/services.cgi b/html/cgi-bin/services.cgi index 58d0a1dbcf..22a9ac707c 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 = ; - @memory = split(/ /,$temp); + if (open(FILE, "/proc/${pid}/status")) { + while () { + my ($key, $val) = split(":", $_, 2); + if ($key eq 'VmRSS') { + $memory = $val; + last; + } + } + close(FILE); } - close FILE; if ($testcmd =~ /$exename/){ - $status = "$Lang::tr{'running'}$pid$memory[0] KB"; + $status = "$Lang::tr{'running'}$pid$memory"; } } return $status;