]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into strongswan-5
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 12 Sep 2012 14:14:31 +0000 (16:14 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 12 Sep 2012 14:14:31 +0000 (16:14 +0200)
1  2 
html/cgi-bin/services.cgi

index 58d0a1dbcf23e31a432417a32c325585bbbddd19,123c3258792ddab8da3350c2c9600dca3132d483..22a9ac707cce13d072c261398fae6c9ed8a25234
@@@ -54,7 -54,7 +54,7 @@@ my %servicenames =
        $Lang::tr{'kernel logging server'} => 'klogd',
        $Lang::tr{'ntp server'} => 'ntpd',
        $Lang::tr{'secure shell server'} => 'sshd',
 -      $Lang::tr{'vpn'} => 'pluto',
 +      $Lang::tr{'vpn'} => 'charon',
        $Lang::tr{'web proxy'} => 'squid',
        'OpenVPN' => 'openvpn'
  );
@@@ -240,7 -240,7 +240,7 @@@ sub isrunning
        my $pid = '';
        my $testcmd = '';
        my $exename;
-       my @memory;
+       my $memory;
  
        $cmd =~ /(^[a-z]+)/;
        $exename = $1;
                        }
                        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;