ajack       2003/10/20 11:20:34

  Modified:    python/gump launcher.py check.py conf.py
  Log:
  Yet another attempt at killing stray processes, to test on Linux...
  
  Revision  Changes    Path
  1.25      +33 -20    jakarta-gump/python/gump/launcher.py
  
  Index: launcher.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/launcher.py,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- launcher.py       20 Oct 2003 16:37:17 -0000      1.24
  +++ launcher.py       20 Oct 2003 18:20:34 -0000      1.25
  @@ -284,11 +284,23 @@
       return result
   
   def killChildProcesses():
  -    pid=os.getpid()
  -    log.warn('Kill all child processed (anything launched by Gumpy) [PID' + 
str(pid) + ']')    
  -    command='pkill -KILL -P ' + str(pid)
  -    exitcode=os.system(command)
  -    log.warn('Command: [' + command + '] exited with [' + str(exitcode) + ']')    
  +    gumpid=default.gumpid
  +    log.warn('Kill all child processed (anything launched by Gumpy) [PID' + 
str(gumpid) + ']')    
  +    command='pgrep -P ' + str(gumpid) + ' -l'
  +    ids=os.popen(command)   
  +    try:     
  +        line=ids.readline()
  +        while line:            
  +            parts=line.split(' ')
  +            pid=parts[0]
  +            process=parts[1]
  +            if not process=='python':
  +                os.kill(childPID,signal.SIGKILL)
  +            
  +            # Get next PID/process combination
  +            line=o.readline()
  +    finally:
  +        if ids: ids.close()
       
   def execute(cmd,tmp=dir.tmp):
       res=CmdResult(cmd)
  @@ -421,28 +433,29 @@
     #set verbosity to show all messages of severity >= default.logLevel
     log.setLevel(default.logLevel)
      
  -  cmd=Cmd('test','testoutput')
  -  cmd.addParameter("A","a")
  -  cmd.addPrefixedParameter("-D","B","b")
  -  cmd.addParameter("C")
  -  cmd.addParameter("A","aa") # Override for earlier
  +
  +#  cmd=Cmd('test','testoutput')
  +#  cmd.addParameter("A","a")
  +#  cmd.addPrefixedParameter("-D","B","b")
  +#  cmd.addParameter("C")
  +#  cmd.addParameter("A","aa") # Override for earlier
     
  -  params=Parameters()
  -  params.addParameter("D")
  -  cmd.addParameters(params)
  +#  params=Parameters()
  +#  params.addParameter("D")
  +#  cmd.addParameters(params)
     
  -  result = execute(cmd)  
  -  dump(result);
  +#  result = execute(cmd)  
  +#  dump(result);
     
  -  cmd=Cmd('ls','ls-test')
  -  result = execute(cmd)  
  -  dump(result);
  +#  cmd=Cmd('ls','ls-test')
  +#  result = execute(cmd)  
  +#  dump(result);
     
     cmd=Cmd('sleep','sleep-test')
  -  cmd.addParameter("30")
  +  cmd.addParameter("300")
     cmd.timeout=10
     result = execute(cmd)  
  -  dump(result);
  +#  dump(result);
     
     
     
  
  
  
  1.27      +6 -6      jakarta-gump/python/gump/check.py
  
  Index: check.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/check.py,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- check.py  15 Oct 2003 20:40:02 -0000      1.26
  +++ check.py  20 Oct 2003 18:20:34 -0000      1.27
  @@ -152,9 +152,9 @@
           context.noRSync=1
           context.addWarning('"rsync" command not found, so attempting recursive copy 
"cp -R"')
           
  -    if not checkExecutable(workspace, context, 'pkill','-help',0): 
  -        context.noPKill=1
  -        context.addWarning('"pkill" command not found, no process clean-ups can 
occur')        
  +    if not checkExecutable(workspace, context, 'pgrep','-help',0): 
  +        context.noPGrep=1
  +        context.addWarning('"pgrep" command not found, no process clean-ups can 
occur')        
       
       context.setState(STATUS_SUCCESS);
       
  
  
  
  1.29      +4 -3      jakarta-gump/python/gump/conf.py
  
  Index: conf.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/conf.py,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- conf.py   20 Oct 2003 14:20:10 -0000      1.28
  +++ conf.py   20 Oct 2003 18:20:34 -0000      1.29
  @@ -89,6 +89,7 @@
       
       gumpfullhost   = socket.gethostname()   
       gumphost   = socket.gethostname().split('.')[0]
  +    gumpid      = os.getpid()    
       workspace  = os.path.normpath('%s/%s.xml' % (dir.base, gumphost))
       globalws   = os.path.normpath('%s/%s' % (dir.base, 'global-workspace.xml'))
       merge      = os.path.normpath('%s/%s' % (dir.work, 'merge.xml'))
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to