1   
  2  import os, sys, time 
  3   
 15   
 17          from twisted.internet import reactor 
 18          print "The %s appears to have (re)started correctly." % processtype 
 19          self.rc = 0 
 20          reactor.stop() 
  21   
 23          from twisted.internet import reactor 
 24          from buildslave.scripts.logwatcher import BuildmasterTimeoutError, \ 
 25               ReconfigError, BuildslaveTimeoutError, BuildSlaveDetectedError 
 26          if why.check(BuildmasterTimeoutError): 
 27              print """ 
 28  The buildslave took more than 10 seconds to start, so we were unable to 
 29  confirm that it started correctly. Please 'tail twistd.log' and look for a 
 30  line that says 'configuration update complete' to verify correct startup. 
 31  """ 
 32          elif why.check(BuildslaveTimeoutError): 
 33              print """ 
 34  The buildslave took more than 10 seconds to start and/or connect to the 
 35  buildslave, so we were unable to confirm that it started and connected 
 36  correctly. Please 'tail twistd.log' and look for a line that says 'message 
 37  from master: attached' to verify correct startup. If you see a bunch of 
 38  messages like 'will retry in 6 seconds', your buildslave might not have the 
 39  correct hostname or portnumber for the buildslave, or the buildslave might 
 40  not be running. If you see messages like 
 41     'Failure: twisted.cred.error.UnauthorizedLogin' 
 42  then your buildslave might be using the wrong botname or password. Please 
 43  correct these problems and then restart the buildslave. 
 44  """ 
 45          elif why.check(ReconfigError): 
 46              print """ 
 47  The buildslave appears to have encountered an error in the master.cfg config 
 48  file during startup. It is probably running with an empty configuration right 
 49  now. Please inspect and fix master.cfg, then restart the buildslave. 
 50  """ 
 51          elif why.check(BuildSlaveDetectedError): 
 52              print """ 
 53  Buildslave is starting up, not following logfile. 
 54  """ 
 55          else: 
 56              print """ 
 57  Unable to confirm that the buildslave started correctly. You may need to 
 58  stop it, fix the config file, and restart. 
 59  """ 
 60              print why 
 61          self.rc = 1 
 62          reactor.stop() 
   63   
 64   
 85   
 87      sys.path.insert(0, os.path.abspath(os.getcwd())) 
 88   
 89       
 90       
 91       
 92      from twisted.python.runtime import platformType 
 93      argv = ["twistd", 
 94              "--no_save", 
 95              "--logfile=twistd.log",  
 96              "--python=buildbot.tac"] 
 97      sys.argv = argv 
 98   
 99       
100       
101       
102      from twisted import __version__ 
103      major, minor, ignored = __version__.split(".", 2) 
104      major = int(major) 
105      minor = int(minor) 
106      if (platformType == "win32" and (major == 2 and minor < 5)): 
107          from twisted.scripts import _twistw 
108          run = _twistw.run 
109      else: 
110          from twisted.scripts import twistd 
111          run = twistd.run 
112      run() 
 113