]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - html/cgi-bin/services.cgi
Merge remote-tracking branch 'stevee/axel-log-fix' into axel-fixperms
[people/teissler/ipfire-2.x.git] / html / cgi-bin / services.cgi
index 424ca868f15161e1694d55217032080ddbc99ace..22a9ac707cce13d072c261398fae6c9ed8a25234 100644 (file)
@@ -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'
 );
@@ -177,9 +177,10 @@ END
                        # blacklist some packages
                        #
                        # alsa has trouble with the volume saving and was not really stopped
+                       # mdadm should not stopped with webif because this could crash the system
                        #
                        chomp($_);
-                       if ($_ ne "alsa"){
+                       if ( ($_ ne "alsa") && ($_ ne "mdadm") ) {
                                $lines++;
                                if ($lines % 2){
                                        print "<tr bgcolor='$color{'color22'}'>";
@@ -239,7 +240,7 @@ sub isrunning{
        my $pid = '';
        my $testcmd = '';
        my $exename;
-       my @memory;
+       my $memory;
 
        $cmd =~ /(^[a-z]+)/;
        $exename = $1;
@@ -255,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;
@@ -279,6 +285,7 @@ sub isrunningaddon{
 
        if ( $testcmd =~ /is\ running/ && $testcmd !~ /is\ not\ running/){
                $status = "<td align='center' bgcolor='${Header::colourgreen}'><font color='white'><b>$Lang::tr{'running'}</b></font></td>";
+               $testcmd =~ s/.* //gi;
                $testcmd =~ s/[a-z_]//gi;
                $testcmd =~ s/\[[0-1]\;[0-9]+//gi;
                $testcmd =~ s/[\(\)\.]//gi;