Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/flaviojs/buildbot
Browse files Browse the repository at this point in the history
* 'master' of git://github.com/flaviojs/buildbot:
  Add --nodaemon to the Command-line Tool documentation.
  Add nodaemon option tests to master.
  Clarify buildbot --nodaemon.
  Clarify buildslave --nodaemon.
  Add option 'nodaemon' to buildbot start/restart.
  Add option 'nodaemon' to buildslave start/restart.
  • Loading branch information
djmitche committed May 7, 2012
2 parents 4590b34 + 3c3df16 commit 2ae0ecb
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions master/buildbot/scripts/runner.py
Expand Up @@ -143,6 +143,7 @@ class RestartOptions(base.BasedirMixin, base.SubcommandOptions):
subcommandFunction = "buildbot.scripts.restart.restart"
optFlags = [
['quiet', 'q', "Don't display startup log messages"],
['nodaemon', None, "Don't daemonize (stay in foreground)"],
]
def getSynopsis(self):
return "Usage: buildbot restart [<basedir>]"
Expand All @@ -152,6 +153,7 @@ class StartOptions(base.BasedirMixin, base.SubcommandOptions):
subcommandFunction = "buildbot.scripts.start.start"
optFlags = [
['quiet', 'q', "Don't display startup log messages"],
['nodaemon', None, "Don't daemonize (stay in foreground)"],
]
def getSynopsis(self):
return "Usage: buildbot start [<basedir>]"
Expand Down
2 changes: 2 additions & 0 deletions master/buildbot/scripts/start.py
Expand Up @@ -71,6 +71,8 @@ def launch(config):
"--no_save",
"--logfile=twistd.log", # windows doesn't use the same default
"--python=buildbot.tac"]
if config['nodaemon']:
argv.extend(['--nodaemon'])
sys.argv = argv

# this is copied from bin/twistd. twisted-2.0.0 through 2.4.0 use
Expand Down
10 changes: 10 additions & 0 deletions master/buildbot/test/unit/test_scripts_runner.py
Expand Up @@ -230,11 +230,21 @@ class TestResetartOptions(BaseTestSimpleOptions, unittest.TestCase):
commandName = 'restart'
optionsClass = runner.RestartOptions

def test_nodaemon(self):
opts = self.parse('--nodaemon')
exp = dict(nodaemon=True)
self.assertOptions(opts, exp)


class TestStartOptions(BaseTestSimpleOptions, unittest.TestCase):
commandName = 'start'
optionsClass = runner.StartOptions

def test_nodaemon(self):
opts = self.parse('--nodaemon')
exp = dict(nodaemon=True)
self.assertOptions(opts, exp)


class TestReconfigOptions(BaseTestSimpleOptions, unittest.TestCase):
commandName = 'reconfig'
Expand Down
8 changes: 8 additions & 0 deletions master/docs/manual/cmdline.rst
Expand Up @@ -85,6 +85,10 @@ buildmaster administrators:
directory. The daemon is launched in the background, with events logged
to a file named :file:`twistd.log`.

--nodaemon
Don't daemonize. The process will start in the foreground.
It will only return to the command-line when it is stopped.

``stop``

This terminates the daemon (either buildmaster or buildslave) running
Expand Down Expand Up @@ -902,6 +906,10 @@ to a file named :file:`twistd.log`. ::

buildbot start BASEDIR

--nodaemon
Don't daemonize. The process will start in the foreground.
It will only return to the command-line when it is stopped.

.. bb:cmdline:: stop (buildslave)
stop
Expand Down
2 changes: 2 additions & 0 deletions slave/buildslave/scripts/runner.py
Expand Up @@ -269,6 +269,7 @@ def postOptions(self):
class StartOptions(MakerBase):
optFlags = [
['quiet', 'q', "Don't display startup log messages"],
['nodaemon', None, "Don't daemonize (stay in foreground)"],
]
def getSynopsis(self):
return "Usage: buildslave start [<basedir>]"
Expand All @@ -280,6 +281,7 @@ def getSynopsis(self):
class RestartOptions(MakerBase):
optFlags = [
['quiet', 'q', "Don't display startup log messages"],
['nodaemon', None, "Don't daemonize (stay in foreground)"],
]
def getSynopsis(self):
return "Usage: buildslave restart [<basedir>]"
Expand Down
2 changes: 2 additions & 0 deletions slave/buildslave/scripts/startup.py
Expand Up @@ -109,6 +109,8 @@ def launch(config):
"--no_save",
"--logfile=twistd.log", # windows doesn't use the same default
"--python=buildbot.tac"]
if config['nodaemon']:
argv.extend(['--nodaemon'])
sys.argv = argv

# this is copied from bin/twistd. twisted-2.0.0 through 2.4.0 use
Expand Down

0 comments on commit 2ae0ecb

Please sign in to comment.