{ "info": { "author": "Florian Schulze", "author_email": "florian.schulze@gmx.net", "bugtrack_url": null, "classifiers": [], "description": "Introduction\n============\n\n**mr.laforge** is a utility and plugin for `supervisord`_.\n\nIt let's you easily make sure that ``supervisord`` and specific processes\ncontrolled by it are running from within shell and Python scripts.\n\nThe plugin part adds a ``kill`` command to send signals to processes.\n\n.. _`supervisord`: http://supervisord.org/\n\n\nUsage\n=====\n\nInstallation as a script\n------------------------\n\nOne way to use it, is by installing it as a script. That's also the way to use\nit in shell scripts. You can either just install it as an egg or you can\ninstall it in a buildout:\n\n.. code-block:: ini\n\n [mr.laforge]\n recipe = zc.recipe.egg\n eggs = mr.laforge\n\nEither way you will get a ``supervisorup``, a ``supervisordown`` and a\n``waitforports`` script.\n\nRunning ``supervisorup`` without arguments will check whether ``supervisord``\nis running and if not will start it. You can also provide process names on the\ncommand line and those will be started if they are not already running.\n\nThe ``supervisordown`` script does the same as ``supervisorup``, but makes sure\nthe process is stopped. This is useful for scripts which initialize a\ndevelopment database and similar tasks.\n\nWith ``waitforports`` you can check whether one or more processes are listening\non the specified ports. The script has some additional arguments you can list\nwith ``-h`` or ``--help``.\n\nYou can set the ``supervisor_args`` keyword argument to set supervisor arguments\nfor the ``supervisorup`` script like the config file location:\n\n.. code-block:: ini\n\n [mr.laforge]\n recipe = zc.recipe.egg\n eggs = mr.laforge\n arguments = supervisor_args=['-c', 'etc/my_supervisord.conf']\n\nAlternatively, supervisor arguments can also be set via the\n``MR_LAFORGE_SUPERVISOR_ARGS`` environment variable.\n\n\nUsage from a Python script\n--------------------------\n\nYou can use the ``up`` method in ``mr.laforge`` which similar to the\n``supervisorup`` script takes process names as arguments.\n\nOne example is a `zc.recipe.testrunner`_ part in a buildout like this:\n\n.. code-block:: ini\n\n [test]\n recipe = zc.recipe.testrunner\n eggs =\n ...\n mr.laforge\n initialization =\n import mr.laforge\n mr.laforge.up('solr-test')\n\nAs you can see, you have to add the egg, so it can be imported by the\ninitialization code added to the ``test`` script created by\n`zc.recipe.testrunner`_. The ``up`` call gets ``solr-test`` as an argument\nto make sure that the ``solr-test`` process is running for the tests.\n\nAnother example is an initialization snippet in a script created by\n`zc.recipe.egg`_:\n\n.. code-block:: ini\n\n [paster]\n recipe = zc.recipe.egg\n eggs =\n ...\n mr.laforge\n dependent-scripts = true\n scripts = paster\n initialization =\n import mr.laforge\n mr.laforge.up('solr')\n\nNow everytime you run the ``paster`` script created by this, it's checked that\n``supervisord`` and the ``solr`` process controlled by it are running.\n\nThe ``down`` method can be used to make sure a process is stopped and is the\nbase of the ``supervisordown`` script. It's used like the ``up`` method above.\n\nThe equivalent for the ``waitforports`` script is ``mr.laforge.waitforports``.\nIt takes a list of ports as arguments, which can be integers or strings which\ncan also contain the host separated with a colon. You can also set the default\nhost with the ``host`` keyword argument and the timeout value with the\n``timeout`` keyword argument. Here is an example:\n\n.. code-block:: python\n\n mr.laforge.waitforports(8080, 'db-server.example.com:5432', timeout=10)\n\n.. _`zc.recipe.testrunner`: http://pypi.python.org/pypi/zc.recipe.testrunner\n.. _`zc.recipe.egg`: http://pypi.python.org/pypi/zc.recipe.egg\n\nThere is also a ``shutdown`` function with which you can shutdown supervisord\nfrom Python code.\n\nAdd as plugin to supervisord\n----------------------------\n\nTo use the plugin part of mr.laforge, you have to add the following to your\nsupervisord config:\n\n.. code-block:: ini\n\n [rpcinterface:laforge]\n supervisor.rpcinterface_factory = mr.laforge.rpcinterface:make_laforge_rpcinterface\n\n [ctlplugin:laforge]\n supervisor.ctl_factory = mr.laforge.controllerplugin:make_laforge_controllerplugin\n\nYou have to make sure that mr.laforge is importable by supervisord. In a\nbuildout you would have to add the egg to supervisor like this:\n\n.. code-block:: ini\n\n [supervisor]\n recipe = zc.recipe.egg\n eggs =\n supervisor\n mr.laforge\n\nNow you can use the ``kill`` command:\n\n.. code-block:: bash\n\n ./bin/supervisorctl kill HUP nginx\n\n\nChangelog\n=========\n\n0.9 - 2019-09-15\n----------------\n\n* Fix import of controllerplugin for Python 3.x.\n [fschulze]\n\n\n0.8 - 2018-07-10\n----------------\n\n* Fix ``do_kill`` for Python 3.x.\n [fschulze]\n\n\n0.7 - 2018-07-02\n----------------\n\n* Add Python 3.x support.\n [fschulze]\n\n* Add timeout to socket, so we don't hang on unavailable hosts.\n [fschulze]\n\n\n0.6 - 2012-10-06\n----------------\n\n* Added ``supervisordown`` script and matching ``down`` method to make sure a\n process is stopped.\n [fschulze]\n\n\n0.5 - 2012-05-23\n----------------\n\n* Allow setting supervisor arguments via the ``MR_LAFORGE_SUPERVISOR_ARGS``\n environment variable.\n [witsch]\n\n* Added ``shutdown`` function to shutdown supervisord from Python code.\n [fschulze]\n\n\n0.4 - 2012-05-09\n----------------\n\n* Added waitforports script and function to wait until a process is listening\n on specified ports.\n [fschulze, witsch]\n\n\n0.3 - 2012-04-03\n----------------\n\n* Don't pass command line options to supervisor code.\n [fschulze]\n\n* Add supervisor_args keyword argument to ``up`` function.\n [fschulze, witsch (Andreas Zeidler)]\n\n\n0.2 - 2011-04-20\n----------------\n\n* Added supervisord plugin with ``kill`` command to send signals to processes.\n [fschulze]\n\n\n0.1 - 2011-04-20\n----------------\n\n* Initial release\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/fschulze/mr.laforge", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "mr.laforge", "package_url": "https://pypi.org/project/mr.laforge/", "platform": "", "project_url": "https://pypi.org/project/mr.laforge/", "project_urls": { "Homepage": "http://github.com/fschulze/mr.laforge" }, "release_url": "https://pypi.org/project/mr.laforge/0.9/", "requires_dist": null, "requires_python": "", "summary": "Plugins and utilities for supervisor", "version": "0.9" }, "last_serial": 5831250, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "8889d35883fb51e25c6ca2abb272db88", "sha256": "bef9b50ec8fb4f40f299d79ef2ea4cab24b30c3f5ddb52f8641f437323de944c" }, "downloads": -1, "filename": "mr.laforge-0.1.zip", "has_sig": false, "md5_digest": "8889d35883fb51e25c6ca2abb272db88", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6909, "upload_time": "2011-04-20T13:48:56", "url": "https://files.pythonhosted.org/packages/ee/09/e520d488e778ec05c39a507a78830c302f5ee474618fe97747711deeec05/mr.laforge-0.1.zip" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "ea56bbc7e773c8242fd03347a4ebb519", "sha256": "893c95301a80fdb994c2dae44ea9d766d3c4fdc52e8dbffcfdea99bffb500977" }, "downloads": -1, "filename": "mr.laforge-0.2.zip", "has_sig": false, "md5_digest": "ea56bbc7e773c8242fd03347a4ebb519", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10001, "upload_time": "2011-04-20T19:26:22", "url": "https://files.pythonhosted.org/packages/1a/6a/eda64932aa12027e1962721784628aa8086e83de7ace79004bbb6a98855a/mr.laforge-0.2.zip" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "1aa7e338ada90b2a2355138bd3389c65", "sha256": "e60d461879ed53c1c1a05af69792355e9d146c2e3707f11c429d5d804cdf405c" }, "downloads": -1, "filename": "mr.laforge-0.3.zip", "has_sig": false, "md5_digest": "1aa7e338ada90b2a2355138bd3389c65", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10487, "upload_time": "2012-04-03T12:59:20", "url": "https://files.pythonhosted.org/packages/35/e5/907dd3bbeba0a42905de75d17805a5a5e456f0c32cd06ce910565ce3b961/mr.laforge-0.3.zip" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "b38e6ffae0c2f24f272ab1b61d622461", "sha256": "abb54698db94df728f9bbadf7623bd9dd22a648f046d51d97cca4ec62d555175" }, "downloads": -1, "filename": "mr.laforge-0.4.zip", "has_sig": false, "md5_digest": "b38e6ffae0c2f24f272ab1b61d622461", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11515, "upload_time": "2012-05-09T14:06:52", "url": "https://files.pythonhosted.org/packages/88/6d/e9ee1636f22e7064e7575118b980018cd0094f01503c39b8e316f9bd7c5d/mr.laforge-0.4.zip" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "b20c6dafdb55787a11f05aa332e5a149", "sha256": "19da443731b68e8083a474e4333c1951b9c4eff22164880ebadcbdb1d1ab19ae" }, "downloads": -1, "filename": "mr.laforge-0.5.zip", "has_sig": false, "md5_digest": "b20c6dafdb55787a11f05aa332e5a149", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12174, "upload_time": "2012-05-23T19:23:09", "url": "https://files.pythonhosted.org/packages/95/6f/55348949648deaf87f6d4f37865a98528a890d4423fd87528957e7f874b7/mr.laforge-0.5.zip" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "a061d72a5d8334cd67ae49e2be25b131", "sha256": "5ccefe007e7abe86f7fd29425457fb69908423b14b8915eea8415f5c9b74d85a" }, "downloads": -1, "filename": "mr.laforge-0.6.zip", "has_sig": false, "md5_digest": "a061d72a5d8334cd67ae49e2be25b131", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13233, "upload_time": "2012-10-06T09:15:36", "url": "https://files.pythonhosted.org/packages/21/9d/c3be155cc32969501dcb4f26f9c0164896d99093df75b1e3300944abe063/mr.laforge-0.6.zip" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "f328fcd2147477e2828be29eba8166ee", "sha256": "251d21c6f1ce1b3dbbecd6c85e0f363342994840195d8b0cf0e0c6143890af06" }, "downloads": -1, "filename": "mr.laforge-0.7-py2-none-any.whl", "has_sig": false, "md5_digest": "f328fcd2147477e2828be29eba8166ee", "packagetype": "bdist_wheel", "python_version": "2", "requires_python": null, "size": 7965, "upload_time": "2018-07-02T08:47:32", "url": "https://files.pythonhosted.org/packages/e6/a7/3c1043302d48f81c7907b3b2a7b4ec1794c12c7dc988327672fb48fecb3b/mr.laforge-0.7-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4215dbb0134ef092fdd1ad3c7596b243", "sha256": "705c9d35d152b32a2590bd0f3218f8be04d5d30036036b51a370dca6b2015acf" }, "downloads": -1, "filename": "mr.laforge-0.7.tar.gz", "has_sig": false, "md5_digest": "4215dbb0134ef092fdd1ad3c7596b243", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6970, "upload_time": "2018-07-02T08:47:31", "url": "https://files.pythonhosted.org/packages/58/92/748bb0e39e7385dc68b9e969a628ded8e6d944907250477d2a2fce0287c0/mr.laforge-0.7.tar.gz" } ], "0.8": [ { "comment_text": "", "digests": { "md5": "946fed1c85942b179d9bc3af1c1431c9", "sha256": "5cd5e8d0a3690cb4792bd5cfee3d716389b26676df9d6b92894071bb63fb19c5" }, "downloads": -1, "filename": "mr.laforge-0.8-py2-none-any.whl", "has_sig": false, "md5_digest": "946fed1c85942b179d9bc3af1c1431c9", "packagetype": "bdist_wheel", "python_version": "2", "requires_python": null, "size": 7988, "upload_time": "2018-07-10T12:43:34", "url": "https://files.pythonhosted.org/packages/ab/63/4febbd1e24eb4941bfd2aacb8d1892afb7a59a85fc0e2761d233ad04fbd2/mr.laforge-0.8-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0df398c319a092d861ed9eb14c66ac10", "sha256": "6915ba2779f30b4a7bead0c177b88c8418dd283cf476abc9069547be592dedef" }, "downloads": -1, "filename": "mr.laforge-0.8.tar.gz", "has_sig": false, "md5_digest": "0df398c319a092d861ed9eb14c66ac10", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7021, "upload_time": "2018-07-10T12:43:33", "url": "https://files.pythonhosted.org/packages/b7/81/120256097847ae30139e2e874bd67a7a1faa62ebb1f89853efa10869152f/mr.laforge-0.8.tar.gz" } ], "0.9": [ { "comment_text": "", "digests": { "md5": "de728d2b2c947501c895ca8e0e99d97c", "sha256": "5fd32f87fb5c02ea558810269b6ccb6fae545013dfa16bab6d22d890cc094219" }, "downloads": -1, "filename": "mr.laforge-0.9-py2-none-any.whl", "has_sig": false, "md5_digest": "de728d2b2c947501c895ca8e0e99d97c", "packagetype": "bdist_wheel", "python_version": "2", "requires_python": null, "size": 8201, "upload_time": "2019-09-15T09:39:18", "url": "https://files.pythonhosted.org/packages/85/a2/09f5d8106344d3902a1722fdb6233a5526c2513ba8fe8f66f5051c7a7dae/mr.laforge-0.9-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "05a2665f726ab0cd5a08c034a06c52a1", "sha256": "7d87848016854522f0eaedde71bfd2ce362f7e29ddb24aec0b1205cf9b431d61" }, "downloads": -1, "filename": "mr.laforge-0.9.tar.gz", "has_sig": false, "md5_digest": "05a2665f726ab0cd5a08c034a06c52a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7043, "upload_time": "2019-09-15T09:39:16", "url": "https://files.pythonhosted.org/packages/13/d7/627b2f1f0e41d40b17947a5f33913c7e9628ed091711aff4a6ff5f1d9b26/mr.laforge-0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "de728d2b2c947501c895ca8e0e99d97c", "sha256": "5fd32f87fb5c02ea558810269b6ccb6fae545013dfa16bab6d22d890cc094219" }, "downloads": -1, "filename": "mr.laforge-0.9-py2-none-any.whl", "has_sig": false, "md5_digest": "de728d2b2c947501c895ca8e0e99d97c", "packagetype": "bdist_wheel", "python_version": "2", "requires_python": null, "size": 8201, "upload_time": "2019-09-15T09:39:18", "url": "https://files.pythonhosted.org/packages/85/a2/09f5d8106344d3902a1722fdb6233a5526c2513ba8fe8f66f5051c7a7dae/mr.laforge-0.9-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "05a2665f726ab0cd5a08c034a06c52a1", "sha256": "7d87848016854522f0eaedde71bfd2ce362f7e29ddb24aec0b1205cf9b431d61" }, "downloads": -1, "filename": "mr.laforge-0.9.tar.gz", "has_sig": false, "md5_digest": "05a2665f726ab0cd5a08c034a06c52a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7043, "upload_time": "2019-09-15T09:39:16", "url": "https://files.pythonhosted.org/packages/13/d7/627b2f1f0e41d40b17947a5f33913c7e9628ed091711aff4a6ff5f1d9b26/mr.laforge-0.9.tar.gz" } ] }