ajack       2004/04/05 08:53:10

  Modified:    python/gump/utils launcher.py
               python/gump gumpenv.py config.py
  Log:
  'timeout' as optional tool for killing rogue child processes.
  
  Revision  Changes    Path
  1.17      +11 -7     gump/python/gump/utils/launcher.py
  
  Index: launcher.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/utils/launcher.py,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- launcher.py       15 Mar 2004 22:07:06 -0000      1.16
  +++ launcher.py       5 Apr 2004 15:53:10 -0000       1.17
  @@ -366,7 +366,7 @@
                 # Log the problem and re-raise
                 log.error('Failed to create CWD [' + cwdpath + ']. Details: ' + 
str(details))
                 raise
  -        
  +              
           # The command line
           execString=cmd.formatCommandLine()        
           
  @@ -401,12 +401,16 @@
               
           #############################################################               
 
           log.debug('Executing: ' + execString + ' (Output to ' + str(outputFile) + 
')')
  -    
  -        # Set the signal handler and an N-second alarm
  -        timeout=cmd.timeout or setting.timeout
  -        timer = Timer(timeout, killChildProcesses)
  -        timer.setDaemon(1)
  -        timer.start()
  +            
  +        # Allow use of 'timeout N cmd args'
  +        if setting.timeoutCommand:
  +            execString='timeout ' + str(timeout) + ' ' + execString
  +        else:
  +            # Set the signal handler and an N-second alarm
  +            timeout=cmd.timeout or setting.timeout
  +            timer = Timer(timeout, killChildProcesses)
  +            timer.setDaemon(1)
  +            timer.start()
   
           #
           # Execute Command & Wait
  
  
  
  1.4       +13 -6     gump/python/gump/gumpenv.py
  
  Index: gumpenv.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/gumpenv.py,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- gumpenv.py        3 Apr 2004 02:36:35 -0000       1.3
  +++ gumpenv.py        5 Apr 2004 15:53:10 -0000       1.4
  @@ -55,14 +55,15 @@
        self.noForrest=0    
        self.noMaven=0          
        self.noRuper=0          
  +     self.noTimeout=0
        self.noSvn=0            
        self.noCvs=0            
  -     self.noJavaHome=0
  -     self.noClasspath=0
  -     self.noJava=0
  -     self.noJavac=0
  -     self.noPGrep=0
  -     self.javaProperties=0
  +        self.noJavaHome=0
  +        self.noClasspath=0
  +        self.noJava=0
  +        self.noJavac=0
  +        self.noPGrep=0
  +        self.javaProperties=0
        
        #
        # JAVACMD can override this, see checkEnvironment
  @@ -149,6 +150,12 @@
               self.noForrest=1
               self.addWarning('"forrest" command not found, no xdoc output')
           
  +        if not self.noTimeout and not self.checkExecutable('timeout','60 env',0): 
  +            self.noTimeout=1
  +            self.addWarning('"timeout" command not found, no in-line command time 
outs')
  +        else:
  +            setting.timeoutCommand=1
  +            
           if not self.noRuper and \
               not self.checkExecutable('ruper','-version',0,0,'check_ruper'): 
               self.noRuper=1
  
  
  
  1.19      +1 -0      gump/python/gump/config.py
  
  Index: config.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/config.py,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- config.py 2 Apr 2004 18:21:13 -0000       1.18
  +++ config.py 5 Apr 2004 15:53:10 -0000       1.19
  @@ -95,6 +95,7 @@
       timeformat='%H:%M:%S (%Z)'
       
       timeout=60*60 # 60 minutes (in seconds)
  +    timeoutCommand=0
       
   class switch:
       """Configuration of switches """   
  
  
  

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

Reply via email to