1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 import os, sys, time
18
30
32 from twisted.internet import reactor
33 print "The %s appears to have (re)started correctly." % processtype
34 self.rc = 0
35 reactor.stop()
36
38 from twisted.internet import reactor
39 from buildslave.scripts.logwatcher import BuildmasterTimeoutError, \
40 ReconfigError, BuildslaveTimeoutError, BuildSlaveDetectedError
41 if why.check(BuildmasterTimeoutError):
42 print """
43 The buildslave took more than 10 seconds to start, so we were unable to
44 confirm that it started correctly. Please 'tail twistd.log' and look for a
45 line that says 'configuration update complete' to verify correct startup.
46 """
47 elif why.check(BuildslaveTimeoutError):
48 print """
49 The buildslave took more than 10 seconds to start and/or connect to the
50 buildslave, so we were unable to confirm that it started and connected
51 correctly. Please 'tail twistd.log' and look for a line that says 'message
52 from master: attached' to verify correct startup. If you see a bunch of
53 messages like 'will retry in 6 seconds', your buildslave might not have the
54 correct hostname or portnumber for the buildslave, or the buildslave might
55 not be running. If you see messages like
56 'Failure: twisted.cred.error.UnauthorizedLogin'
57 then your buildslave might be using the wrong botname or password. Please
58 correct these problems and then restart the buildslave.
59 """
60 elif why.check(ReconfigError):
61 print """
62 The buildslave appears to have encountered an error in the master.cfg config
63 file during startup. It is probably running with an empty configuration right
64 now. Please inspect and fix master.cfg, then restart the buildslave.
65 """
66 elif why.check(BuildSlaveDetectedError):
67 print """
68 Buildslave is starting up, not following logfile.
69 """
70 else:
71 print """
72 Unable to confirm that the buildslave started correctly. You may need to
73 stop it, fix the config file, and restart.
74 """
75 print why
76 self.rc = 1
77 reactor.stop()
78
79
100
102 sys.path.insert(0, os.path.abspath(os.getcwd()))
103
104
105
106
107 from twisted.python.runtime import platformType
108 argv = ["twistd",
109 "--no_save",
110 "--logfile=twistd.log",
111 "--python=buildbot.tac"]
112 if config['nodaemon']:
113 argv.extend(['--nodaemon'])
114 sys.argv = argv
115
116
117
118
119 from twisted import __version__
120 major, minor, ignored = __version__.split(".", 2)
121 major = int(major)
122 minor = int(minor)
123 if (platformType == "win32" and (major == 2 and minor < 5)):
124 from twisted.scripts import _twistw
125 run = _twistw.run
126 else:
127 from twisted.scripts import twistd
128 run = twistd.run
129 run()
130