[Buildbot-commits] buildbot/buildbot/scripts runner.py,1.41,1.42

Brian Warner warner at users.sourceforge.net
Sun Mar 12 11:54:02 UTC 2006


Update of /cvsroot/buildbot/buildbot/buildbot/scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27713/buildbot/scripts

Modified Files:
	runner.py 
Log Message:
* buildbot/scripts/runner.py: add 'buildbot restart' command
(stop): don't sys.exit() out of here, otherwise restart can't work
* docs/buildbot.texinfo (Shutdown): document it


Index: runner.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- runner.py	17 Feb 2006 07:23:13 -0000	1.41
+++ runner.py	12 Mar 2006 11:54:00 -0000	1.42
@@ -347,11 +347,20 @@
             os.kill(pid, 0)
         except OSError:
             print "buildbot process %d is dead" % pid
-            sys.exit(0)
+            return
         timer += 1
         time.sleep(1)
     print "never saw process go away"
 
+def restart(config):
+    stop(config, wait=True)
+    print "now restarting buildbot process.."
+    start(config)
+    # this next line might not be printed, if start() ended up running twistd
+    # inline
+    print "buildbot process has been restarted"
+
+
 def loadOptions(filename="options", here=None, home=None):
     """Find the .buildbot/FILENAME file. Crawl from the current directory up
     towards the root, and also look in ~/.buildbot . The first directory
@@ -419,6 +428,10 @@
     def getSynopsis(self):
         return "Usage:    buildbot stop <basedir>"
 
+class RestartOptions(MakerBase):
+    def getSynopsis(self):
+        return "Usage:    buildbot restart <basedir>"
+
 class DebugClientOptions(usage.Options):
     optFlags = [
         ['help', 'h', "Display this message"],
@@ -654,6 +667,9 @@
          "Create and populate a directory for a new buildslave"],
         ['start', None, StartOptions, "Start a buildmaster or buildslave"],
         ['stop', None, StopOptions, "Stop a buildmaster or buildslave"],
+        ['restart', None, RestartOptions,
+         "Restart a buildmaster or buildslave"],
+
         ['sighup', None, StopOptions,
          "SIGHUP a buildmaster to make it re-read the config file"],
 
@@ -713,6 +729,8 @@
         start(so)
     elif command == "stop":
         stop(so, wait=True)
+    elif command == "restart":
+        restart(so)
     elif command == "sighup":
         stop(so, "HUP")
     elif command == "sendchange":





More information about the Commits mailing list