Commits

Tres Seaver committed b91e564

[svn r967] Sphinxify docs.

Comments (0)

Files changed (6)

trunk/CHANGES.txt

 Next Release
 ------------
 
+- Sphinxified documentation.
+
 - Fixed test_suite to use the correct module name in setup.py.
 
 - Fixed the tests for memmon to import the correct module.
-superlance plugins for supervisor
-=================================
+superlance README
+=================
 
-Superlance is a package of plugin utilities for monitoring and
-controlling processes that run under `supervisor
-<http://supervisord.org>`_.
+Superlance is a package of plugin utilities for monitoring and controlling
+processes that run under `supervisor <http://supervisord.org>`_.
 
-Currently, it provides two scripts:
-
-``httpok`` -- This script can be used as a supervisor event listener
-(subscribed to TICK events) which will restart a "hung" HTTP server
-process, which is defined as a process in the RUNNING state which does
-not respond in an appropriate or timely manner to an HTTP GET request.
-
-``crashmail`` -- This script will email a user when a process enters
-the EXITED state unexpectedly.
-
-``memmon`` -- See the description below.
-
-
-Memmon Overview
----------------
-
-memmon is a supervisor "event listener" which may be subscribed to a
-concrete TICK_x event. When memmon receives a TICK_x event (TICK_60 is
-recommended, indicating activity every 60 seconds), memmon checks that a
-configurable list of programs (or all programs running under supervisor) are
-not exceeding a configurable about of memory (resident segment size, or RSS).
-If one or more of these processes is consuming more than the amount of memory
-that memmon believes it should, memmon will restart the process. memmon can be
-configured to send an email notification when it restarts a process.
-
-memmon is known to work on Linux and Mac OS X, but has not been tested on
-other operating systems (it relies on ps output and command-line switches).
-
-memmon is incapable of monitoring the process status of processes which are
-not supervisord child processes.
-
-Memmon Command
---------------
-
-memmon is a "console script" installed when you install supervisor. Although
-memmon is an executable program, it isn't useful as a general-purpose script:
-it must be run as a supervisor event listener to do anything useful. memmon
-accepts the following options:
-
-  Option       Argument(s)      Description
-  -----------  ---------------  ----------------------
-  -h           N/A              Show program help.
-  --help
-
-  -p           name/size pair   A name/size pair, e.g. "foo=1MB". The name 
-  --program                     represents the supervisor program name that 
-                                you'd like memmon to monitor, the size represents
-                                the number of bytes (suffix-multiplied using "KB", 
-                                "MB" or "GB") that should be considered "too much".
-                                Multiple -p options can be provided to memmon to
-                                signify that you'd like to monitor more than one 
-                                program. Programs can be specified as a "namespec",
-                                to disambiguate same-named programs in different
-                                groups, e.g. "foo:bar" represents the program "bar"
-                                in the "foo" group.
-
-  -g           name/size pair   A groupname/size pair, e.g. "group=1MB". The name
-  --groupname                   represents the supervisor group name that you'd
-                                like memmon to monitor, the size represents the
-                                number of bytes (suffix-multiplied using "KB", "MB"
-                                or "GB") that should be considered "too much". 
-                                Multiple -g options can be provided to memmon to
-                                signify that you'd like to monitor more than one
-                                group.  If any process in this group exceeds the 
-                                maximum, it will be restarted.   
-
-  -a           size             A size (suffix-multiplied using "KB", "MB" or "GB") 
-  --any                         that should be considered "too much". If any program
-                                running as a child of supervisor exceeds this maximum,
-	 	                            it will be restarted. E.g. 100MB. 
-
-  -s           command          A command that will send mail if passed the email 
-  --sendmail                    body (including the headers).  Defaults to
-    _program                    "/usr/sbin/sendmail -t -i". Specifying this doesn't 
-                                cause memmon to send mail by itself (see the 
-                                -m/--email option). 
-
-  -m           email address    An email address to which to send email when a process
-  --email                       is restarted. By default, memmon will not send any mail
-                                unless an email address is specified. 
-
-Configuring Memmon Into the Supervisor Config
----------------------------------------------
-
-An [eventlistener:x] section must be placed in supervisord.conf in order for
-memmon to begin working. See the "Events" chapter in the Supervisor manual
-for more information about event listeners. The following examples assume that
-the memmon is on your system PATH.
-
-    memmon Example Configuration 1
-
-        This configuration causes memmon to restart any process which is a
-        child of supervisord consuming more than 200MB of RSS, and will send
-        mail to bob@example.com when it restarts a process using the default
-        sendmail command.
-
-        [eventlistener:memmon]
-        command=memmon -a 200MB -m bob@example.com
-        events=TICK_60
-
-    memmon Example Configuration 2
-
-        This configuration causes memmon to restart any process with the
-        supervisor program name "foo" consuming more than 200MB of RSS, and
-        will send mail to bob@example.com when it restarts a process using the
-        default sendmail command.
-
-        [eventlistener:memmon]
-        command=memmon -p foo=200MB -m bob@example.com
-        events=TICK_60
-
-    memmon Example Configuration 3            
-
-        This configuration causes memmon to restart any process in the process
-        group "bar" consuming more than 200MB of RSS, and will send mail to
-        bob@example.com when it restarts a process using the default sendmail
-        command.
-
-        [eventlistener:memmon]
-        command=memmon -g bar=200MB -m bob@example.com
-        events=TICK_60
+Please see ``docs/index.rst`` for complete documentation.

trunk/docs/Makefile

+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS    =
+SPHINXBUILD   = sphinx-build
+PAPER         =
+BUILDDIR      = _build
+
+# Internal variables.
+PAPEROPT_a4     = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest
+
+help:
+	@echo "Please use \`make <target>' where <target> is one of"
+	@echo "  html      to make standalone HTML files"
+	@echo "  dirhtml   to make HTML files named index.html in directories"
+	@echo "  pickle    to make pickle files"
+	@echo "  json      to make JSON files"
+	@echo "  htmlhelp  to make HTML files and a HTML help project"
+	@echo "  qthelp    to make HTML files and a qthelp project"
+	@echo "  latex     to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+	@echo "  changes   to make an overview of all changed/added/deprecated items"
+	@echo "  linkcheck to check all external links for integrity"
+	@echo "  doctest   to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+	-rm -rf $(BUILDDIR)/*
+
+html:
+	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+pickle:
+	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+	@echo
+	@echo "Build finished; now you can process the pickle files."
+
+json:
+	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+	@echo
+	@echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+	@echo
+	@echo "Build finished; now you can run HTML Help Workshop with the" \
+	      ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+	@echo
+	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
+	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/superlance.qhcp"
+	@echo "To view the help file:"
+	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/superlance.qhc"
+
+latex:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo
+	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+	@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
+	      "run these through (pdf)latex."
+
+changes:
+	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+	@echo
+	@echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+	@echo
+	@echo "Link check complete; look for any errors in the above output " \
+	      "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+	@echo "Testing of doctests in the sources finished, look at the " \
+	      "results in $(BUILDDIR)/doctest/output.txt."

trunk/docs/conf.py

+# -*- coding: utf-8 -*-
+#
+# superlance documentation build configuration file, created by
+# sphinx-quickstart on Thu Jun 10 11:55:43 2010.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.append(os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'superlance'
+copyright = u'2010, Chris McDonough, Agendaless Consulting, Inc.'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '0.6'
+# The full version, including alpha/beta/rc tags.
+release = '0.6'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of documents that shouldn't be included in the build.
+#unused_docs = []
+
+# List of directories, relative to source directory, that shouldn't be searched
+# for source files.
+exclude_trees = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages.  Major themes that come with
+# Sphinx are currently 'default' and 'sphinxdoc'.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further.  For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents.  If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_use_modindex = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.  The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = ''
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'superlancedoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+# The paper size ('letter' or 'a4').
+#latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+#latex_font_size = '10pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+  ('index', 'superlance.tex', u'superlance Documentation',
+   u'Chris McDonough, Agendaless Consulting, Inc.', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_use_modindex = True

trunk/docs/index.rst

+superlance plugins for supervisor
+=================================
+
+Superlance is a package of plugin utilities for monitoring and
+controlling processes that run under `supervisor
+<http://supervisord.org>`_.
+
+Currently, it provides three scripts:
+
+``httpok`` -- This script can be used as a supervisor event listener
+(subscribed to TICK events) which will restart a "hung" HTTP server
+process, which is defined as a process in the RUNNING state which does
+not respond in an appropriate or timely manner to an HTTP GET request.
+
+``crashmail`` -- This script will email a user when a process enters
+the EXITED state unexpectedly.
+
+``memmon`` -- See the description below.
+
+
+Contents:
+
+.. toctree::
+   :maxdepth: 2
+
+   memmon
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+

trunk/docs/memmon.rst

+:command:`memmon` Overview
+==========================
+
+:command:`memmon` is a supervisor "event listener" which may be subscribed to
+a concrete ``TICK_x`` event. When memmon receives a ``TICK_x`` event (
+``TICK_60`` is recommended, indicating activity every 60 seconds),
+:command:`memmon` checks that a configurable list of programs (or all
+programs running under supervisor) are not exceeding a configurable about of
+memory (resident segment size, or RSS).  If one or more of these processes is
+consuming more than the amount of memory that :command:`memmon` believes it
+should, :command:`memmon` will restart the process. :command:`memmon` can be
+configured to send an email notification when it restarts a process.
+
+:command:`memmon` is known to work on Linux and Mac OS X, but has not been
+tested on other operating systems (it relies on :command:`ps` output and
+command-line switches).
+
+:command:`memmon` is incapable of monitoring the process status of processes
+which are not supervisord child processes.
+
+Command-Line Syntax
+-------------------
+
+:command:`memmon` is a "console script" installed when you install supervisor.
+Although memmon is an executable program, it isn't useful as a general-purpose
+script:  it must be run as a supervisor event listener to do anything useful.
+
+:command:`memmon` accepts the following options:
+
+.. program:: memmon
+
+.. cmdoption:: -h, --help
+
+   Show program help.
+
+.. cmdoption:: -p <name/size pair>, --program=<name/size pair>
+
+   A name/size pair, e.g. "foo=1MB". The name represents the supervisor
+   program name that you would like :command:`memmon` to monitor; the size
+   represents the number of bytes (suffix-multiplied using "KB", "MB" or "GB")
+   that should be considered "too much".
+
+   Multiple ``-p`` options can be provided to have :command:`memmon` monitor
+   more than one program.
+
+   Programs can be specified using a "namespec", to disambiguate same-named
+   programs in different groups, e.g. ``foo:bar`` represents the program
+   ``bar`` in the ``foo`` group.
+
+.. cmdoption:: -g <name/size pair>, --groupname=<name/size pair>
+
+   A groupname/size pair, e.g. "group=1MB". The name represents the supervisor
+   group name that you would like :command:`memmon` to monitor; the size
+   represents the number of bytes (suffix-multiplied using "KB", "MB" or "GB")
+   that should be considered "too much".
+
+   Multiple ``-g`` options can be provided to have :command:`memmon` monitor
+   more than one group.  If any process in this group exceeds the maximum,
+   it will be restarted.
+
+.. cmdoption:: -a <size>, --any=<size>
+
+   A size (suffix-multiplied using "KB", "MB" or "GB") that should be
+   considered "too much". If any program running as a child of supervisor
+   exceeds this maximum, it will be restarted. E.g. 100MB.
+
+.. cmdoption:: -s <command>, --sendmail=<command>
+
+   A command that will send mail if passed the email body (including the
+   headers).  Defaults to ``/usr/sbin/sendmail -t -i``.
+
+.. note::
+
+   Specifying this option doesn't cause memmon to send mail by itself:
+   see the ``-m`` / ``--email`` option.
+
+.. cmdoption:: -m <email address>, --email=<email address>
+
+   An email address to which to send email when a process is restarted.
+   By default, memmon will not send any mail unless an email address is
+   specified.
+
+
+Configuring :command:`memmon` Into the Supervisor Config
+--------------------------------------------------------
+
+An ``[eventlistener:x]`` section must be placed in :file:`supervisord.conf`
+in order for :command:`memmon` to do its work. See the "Events" chapter in the
+Supervisor manual for more information about event listeners.
+
+The following examples assume that the memmon is on your system :envvar:`PATH`.
+
+Example Configuration 1
+#######################
+
+This configuration causes :command:`memmon` to restart any process which is
+a child of :command:`supervisord` consuming more than 200MB of RSS, and will
+send mail to ``bob@example.com`` when it restarts a process using the
+default :command:`sendmail` command.
+
+.. code-block:: ini
+
+   [eventlistener:memmon]
+   command=memmon -a 200MB -m bob@example.com
+   events=TICK_60
+
+
+Example Configuration 2
+#######################
+
+This configuration causes :command:`memmon` to restart any process with the
+supervisor program name ``foo`` consuming more than 200MB of RSS, and
+will send mail to ``bob@example.com`` when it restarts a process using
+the default sendmail command.
+
+.. code-block:: ini
+
+   [eventlistener:memmon]
+   command=memmon -p foo=200MB -m bob@example.com
+   events=TICK_60
+
+
+Example Configuration 3
+#######################
+
+This configuration causes :command:`memmon` to restart any process in the
+process group "bar" consuming more than 200MB of RSS, and will send mail to
+``bob@example.com`` when it restarts a process using the default
+:command:`sendmail` command.
+
+.. code-block:: ini
+
+   [eventlistener:memmon]
+   command=memmon -g bar=200MB -m bob@example.com
+   events=TICK_60