[Ultrapossum-cvs 187] demo/haviewer 1.2,1.3,haviewer.pl

Back to archive index

Masato Taruishi taru****@sourc*****
2004年 6月 18日 (金) 15:18:25 JST


===================================================================
RCS file: demo/haviewer/haviewer.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- demo/haviewer/haviewer.pl	2004/06/18 05:35:40	1.2
+++ demo/haviewer/haviewer.pl	2004/06/18 06:18:25	1.3
@@ -78,7 +78,7 @@
   };
 
   $status{type} = $conf->{TYPE};
-  $status{status} = `$conf->{MODULEDIR}/server/pid status $conf->{CHROOTDIRECTORY}$conf->{SLAPD_PIDFILE}`;
+  $status{status} = `$conf->{MODULEDIR}/server/pid status $conf->{CHROOTDIRECTORY}$conf->{SLAPD_PIDFILE} 2> /dev/null`;
   chomp $status{status};
   if ( $status{status} eq 'running' ) {
     $status{status} = "ACTIVE";
@@ -87,14 +87,21 @@
     $status{since} = `LANG=C date -r $conf->{CHROOTDIRECTORY}$conf->{SLAPD_PIDFILE}`;
     chomp $status{since};
   } else {
-    $status{status} = `$conf->{MODULEDIR}/server/pid status $conf->{SLAPD_SLAVE_PIDFILE}`;
+    $status{status} = `$conf->{MODULEDIR}/server/pid status $conf->{SLAPD_SLAVE_PIDFILE} 2> /dev/null`;
     chomp $status{status};
     if( $status{status} eq 'running' ) {
       $status{status} = "STANDBY";
       $status{since} = `LANG=C date -r $conf->{SLAPD_SLAVE_PIDFILE}`;
       chomp $status{since};
     } else {
-      $status{status} = "stopped";
+      system("$conf->{MODULEDIR}/server/pid status $conf->{SLAPD_PIDFILE} 2>&1 | grep -q 'W:' 2> /dev/null > /dev/null");
+      if( $? != 0 ) {
+        $status{status} = "STOP";
+      } else {
+        $status{status} = "DEAD";
+      }
+      $status{pid} = "-----";
+      $status{since} = "-----";
     }
   }
   return $status; 



Ultrapossum-cvs メーリングリストの案内
Back to archive index