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 buildmaster appears to have (re)started correctly."
34 self.rc = 0
35 reactor.stop()
36
38 from twisted.internet import reactor
39 from buildbot.scripts.logwatcher import BuildmasterTimeoutError
40 from buildbot.scripts.logwatcher import ReconfigError
41 if why.check(BuildmasterTimeoutError):
42 print """
43 The buildmaster 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(ReconfigError):
48 print """
49 The buildmaster appears to have encountered an error in the master.cfg config
50 file during startup. Please inspect and fix master.cfg, then restart the
51 buildmaster.
52 """
53 else:
54 print """
55 Unable to confirm that the buildmaster started correctly. You may need to
56 stop it, fix the config file, and restart.
57 """
58 print why
59 self.rc = 1
60 reactor.stop()
61
62
64 os.chdir(config['basedir'])
65 if not os.path.exists("buildbot.tac"):
66 print "This doesn't look like a buildbot base directory:"
67 print "No buildbot.tac file."
68 print "Giving up!"
69 sys.exit(1)
70 if config['quiet']:
71 return launch(config)
72
73
74 from twisted.python.runtime import platformType
75 if platformType == "win32":
76 return launch(config)
77
78
79
80 if os.fork():
81
82 rc = Follower().follow()
83 sys.exit(rc)
84
85
86 time.sleep(0.2)
87 launch(config)
88
90 sys.path.insert(0, os.path.abspath(os.getcwd()))
91
92
93
94
95 argv = ["twistd",
96 "--no_save",
97 "--logfile=twistd.log",
98 "--python=buildbot.tac"]
99 sys.argv = argv
100
101
102
103
104 from twisted.scripts import twistd
105 twistd.run()
106