You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by cw...@apache.org on 2014/05/16 19:25:16 UTC

svn commit: r1595271 - in /uima/sandbox/uima-ducc/trunk: src/main/resources/ducc.properties uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/metrics/collectors/NodeUsersCollector.java

Author: cwiklik
Date: Fri May 16 17:25:16 2014
New Revision: 1595271

URL: http://svn.apache.org/r1595271
Log:
UIMA-3829 Cleared user exclusion list in ducc.properties. Modified rogue process detector to ignore processes owned by UIDs < 500 as these are system processes and thus not rogue.

Modified:
    uima/sandbox/uima-ducc/trunk/src/main/resources/ducc.properties
    uima/sandbox/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/metrics/collectors/NodeUsersCollector.java

Modified: uima/sandbox/uima-ducc/trunk/src/main/resources/ducc.properties
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/src/main/resources/ducc.properties?rev=1595271&r1=1595270&r2=1595271&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/src/main/resources/ducc.properties (original)
+++ uima/sandbox/uima-ducc/trunk/src/main/resources/ducc.properties Fri May 16 17:25:16 2014
@@ -401,7 +401,7 @@ ducc.agent.launcher.process.stop.timeout
 # Max time in millis allowed for AE initialization. Default 2 hours 7200000.                                                                 
 ducc.agent.launcher.process.init.timeout=7200000
 # exclude the following user ids while detecting rogue processes
-ducc.agent.rogue.process.user.exclusion.filter=root,postfix,ntp,nobody,daemon,100
+ducc.agent.rogue.process.user.exclusion.filter=
 #exclude the following processes while detecting rogue processes
 ducc.agent.rogue.process.exclusion.filter=sshd:,-bash,-sh,/bin/sh,/bin/bash,grep,ps
 # Fudge Factor (in terms of percantage) that agent uses to multiply a share size when 

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/metrics/collectors/NodeUsersCollector.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/metrics/collectors/NodeUsersCollector.java?rev=1595271&r1=1595270&r2=1595271&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/metrics/collectors/NodeUsersCollector.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/metrics/collectors/NodeUsersCollector.java Fri May 16 17:25:16 2014
@@ -205,9 +205,9 @@ public class NodeUsersCollector implemen
 
       ProcessBuilder pb;
       if ( Utils.isMac() ) {
-        pb = new ProcessBuilder("ps","-Ao","user=,pid=,ppid=,args=");
+        pb = new ProcessBuilder("ps","-Ao","user=,pid=,ppid=,args=,uid=");
       } else {
-        pb = new ProcessBuilder("ps","-Ao","user:12,pid,ppid,args", "--no-heading");
+        pb = new ProcessBuilder("ps","-Ao","user:12,pid,ppid,args,uid", "--no-heading");
       }
       pb.redirectErrorStream(true);
       Process proc = pb.start();
@@ -269,12 +269,18 @@ public class NodeUsersCollector implemen
         String pid = tokens[1];
         String ppid = tokens[2];
         String cmd = tokens[3];
+        String uid = tokens[4];
         
         if ( tokens.length > 0 ) {
-//        	RunningProcess p = 
-//                    new RunningProcess(pid,ppid,user);
-//            tempProcessList.add(p);
-            //	walk up the tree of ancestor processes to check if any is owned by ducc. If so, this
+        	try {
+        		// by convention processes owned by uid < 500 are system processes thus not rogue
+        		if ( Integer.valueOf(uid) < 500 ) {
+        			continue;    
+        		}
+        	} catch( NumberFormatException nfe) {
+        		
+        	}
+        	//	walk up the tree of ancestor processes to check if any is owned by ducc. If so, this
             //  process is not rogue.
             if ( processAncestorIsOwnedByDucc(pid, tempProcessList)) {
             	continue;  // skip as this is not a rogue process