Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 9457b02689c69e152aa2cda68176fa51 > files > 74

buildbot-doc-0.8.4p1-2.fc16.noarch.rpm

<html lang="en">
<head>
<title>Debug Options - BuildBot Manual - 0.8.4p1</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="BuildBot Manual - 0.8.4p1">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Global-Configuration.html#Global-Configuration" title="Global Configuration">
<link rel="prev" href="Defining-Global-Properties.html#Defining-Global-Properties" title="Defining Global Properties">
<link rel="next" href="Metrics-Options.html#Metrics-Options" title="Metrics Options">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This is the BuildBot manual for Buildbot version 0.8.4p1.

Copyright (C) 2005, 2006, 2009, 2010 Brian Warner

Copying and distribution of this file, with or without
modification, are permitted in any medium without royalty
provided the copyright notice and this notice are preserved.-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
</head>
<body>
<div class="node">
<a name="Debug-Options"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Metrics-Options.html#Metrics-Options">Metrics Options</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Defining-Global-Properties.html#Defining-Global-Properties">Defining Global Properties</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Global-Configuration.html#Global-Configuration">Global Configuration</a>
<hr>
</div>

<h4 class="subsection">4.6.10 Debug Options</h4>

<p><a name="index-c_005b_0027debugPassword_0027_005d-38"></a>If you set <code>c['debugPassword']</code>, then you can connect to the
buildmaster with the diagnostic tool launched by <code>buildbot
debugclient MASTER:PORT</code>. From this tool, you can reload the config
file, manually force builds, and inject changes, which may be useful
for testing your buildmaster without actually commiting changes to
your repository (or before you have the Change Sources set up). The
debug tool uses the same port number as the slaves do:
<code>c['slavePortnum']</code>, and is authenticated with this password.

<pre class="example">     c['debugPassword'] = "debugpassword"
</pre>
   <p><a name="index-c_005b_0027manhole_0027_005d-39"></a>If you set <code>c['manhole']</code> to an instance of one of the classes in
<code>buildbot.manhole</code>, you can telnet or ssh into the buildmaster
and get an interactive Python shell, which may be useful for debugging
buildbot internals. It is probably only useful for buildbot
developers. It exposes full access to the buildmaster's account
(including the ability to modify and delete files), so it should not
be enabled with a weak or easily guessable password.

   <p>There are three separate <code>Manhole</code> classes. Two of them use SSH,
one uses unencrypted telnet. Two of them use a username+password
combination to grant access, one of them uses an SSH-style
<samp><span class="file">authorized_keys</span></samp> file which contains a list of ssh public keys.

   <p>Note that using any Manhole requires that <code>pycrypto</code> and <code>pyasn1</code> be
installed.  These are not part of the normal Buildbot dependencies.

     <dl>
<dt><code>buildbot.manhole.AuthorizedKeysManhole</code><dd>You construct this with the name of a file that contains one SSH
public key per line, just like <samp><span class="file">~/.ssh/authorized_keys</span></samp>. If you
provide a non-absolute filename, it will be interpreted relative to
the buildmaster's base directory.

     <br><dt><code>buildbot.manhole.PasswordManhole</code><dd>This one accepts SSH connections but asks for a username and password
when authenticating. It accepts only one such pair.

     <br><dt><code>buildbot.manhole.TelnetManhole</code><dd>This accepts regular unencrypted telnet connections, and asks for a
username/password pair before providing access. Because this
username/password is transmitted in the clear, and because Manhole
access to the buildmaster is equivalent to granting full shell
privileges to both the buildmaster and all the buildslaves (and to all
accounts which then run code produced by the buildslaves), it is
highly recommended that you use one of the SSH manholes instead.

   </dl>

<pre class="example">     # some examples:
     from buildbot import manhole
     c['manhole'] = manhole.AuthorizedKeysManhole(1234, "authorized_keys")
     c['manhole'] = manhole.PasswordManhole(1234, "alice", "mysecretpassword")
     c['manhole'] = manhole.TelnetManhole(1234, "bob", "snoop_my_password_please")
</pre>
   <p>The <code>Manhole</code> instance can be configured to listen on a specific
port. You may wish to have this listening port bind to the loopback
interface (sometimes known as &ldquo;lo0&rdquo;, &ldquo;localhost&rdquo;, or 127.0.0.1) to
restrict access to clients which are running on the same host.

<pre class="example">     from buildbot.manhole import PasswordManhole
     c['manhole'] = PasswordManhole("tcp:9999:interface=127.0.0.1","admin","passwd")
</pre>
   <p>To have the <code>Manhole</code> listen on all interfaces, use
<code>"tcp:9999"</code> or simply 9999. This port specification uses
<code>twisted.application.strports</code>, so you can make it listen on SSL
or even UNIX-domain sockets if you want.

   <p>The buildmaster's SSH server will use a different host key than the
normal sshd running on a typical unix host. This will cause the ssh
client to complain about a &ldquo;host key mismatch&rdquo;, because it does not
realize there are two separate servers running on the same host. To
avoid this, use a clause like the following in your <samp><span class="file">.ssh/config</span></samp>
file:

<pre class="example">     Host remotehost-buildbot
      HostName remotehost
      HostKeyAlias remotehost-buildbot
      Port 9999
      # use 'user' if you use PasswordManhole and your name is not 'admin'.
      # if you use AuthorizedKeysManhole, this probably doesn't matter.
      User admin
</pre>
   <h3 class="heading">Using Manhole</h3>

<p>After you have connected to a manhole instance, you will find yourself at a
Python prompt.  You have access to two objects: <code>master</code> (the BuildMaster)
and <code>status</code> (the master's Status object).  Most interesting objects on
the master can be reached from these two objects.

   <p>To aid in navigation, the <code>show</code> method is defined.  It displays the
non-method attributes of an object.

   <p>A manhole session might look like:

<pre class="example">     &gt;&gt;&gt; show(master)
     data attributes of &lt;buildbot.master.BuildMaster instance at 0x7f7a4ab7df38&gt;
                            basedir : '/home/dustin/code/buildbot/t/buildbot/'...
                          botmaster : &lt;type 'instance'&gt;
                     buildCacheSize : None
                       buildHorizon : None
                        buildbotURL : http://localhost:8010/
                    changeCacheSize : None
                         change_svc : &lt;type 'instance'&gt;
                     configFileName : master.cfg
                                 db : &lt;class 'buildbot.db.connector.DBConnector'&gt;
                   db_poll_interval : None
                             db_url : sqlite:///state.sqlite
                                   ...
     &gt;&gt;&gt; show(master.botmaster.builders['win32'])
     data attributes of &lt;Builder ''builder'' at 48963528&gt;
                                   ...
     &gt;&gt;&gt; win32 = _
     &gt;&gt;&gt; win32.category = 'w32'
</pre>
   </body></html>