{ "info": { "author": "Mustapha Benali", "author_email": "mustapha@headnet.dk", "bugtrack_url": null, "classifiers": [ "Framework :: Buildout", "Intended Audience :: Developers", "License :: OSI Approved :: Zope Public License", "Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": ".. contents::\n\n- Code repository: https://svn.plone.org/svn/collective/buildout/collective.recipe.supervisor\n\nChange history\n**************\n\n0.18 (Unknown)\n=================\n\n\n0.17 (2011-07-28)\n====================\n- Added support for process groups\n [nueces]\n\n0.16 (2011-03-07)\n=================\n\n- Fix supervisorctl to use unix_http_server if used\n [Domen Ko\u017ear, NiteoWeb. Work sponsored by Hexagon IT]\n\n0.15 (2011-03-05)\n=================\n\n- Added support for unix_http_server additionally to inet_http_server\n [Domen Ko\u017ear, NiteoWeb. Work sponsored by Hexagon IT]\n\n0.14 (2010-12-10)\n=================\n\n - Added support for the umask option of supervisord\n [servilio@mcmaster.ca]\n\n - Move the credentials needed for authenticating with the supervisord\n process from the supervisorctl script to the configuration\n file. Because of bug 180705 of zc.buildout, scripts are made\n world-readable. [servilio@mcmaster.ca]\n\n0.13 (2010-12-07)\n=================\n\n - 'nocleanup' option of Supervisor is now configurable from Buildout\n Patch from Damien Letournel\n\n0.12 (2010-08-04)\n=================\n\n - Quote the environment variables that are written in the supervisor\n configuration file for eventlisteners, otherwise supervisor will not pass\n them on correctly to for example memmon [Fred van Dijk]\n\n0.11 (2010-08-02)\n=================\n\n - 'childlogdir' option of Supervisor is now configurable from Buildout\n [Jonathan Ballet]\n\n - [include] functionnality in the supervisor configuration file.\n See http://supervisord.org/configuration.html#include\n [ycadour]\n\n0.10.1 (2010-07-27)\n===================\n- Updated documentation about how to use the memmon event listener [lucielejard]\n\n0.10 (2010-06-03)\n=================\n - Added an option for the environment variable PATH\n [lucielejard]\n - Added support for disabling supervisor sections (such as http, rpc and ctl) [Domen Kozar]\n\n\n0.9 (2009-11-04)\n================\n\n - Applied Jonathan Ballet's patch: The generated control script doesn't \n automatically connect on the created supervisord when running on a custom port. \n\n0.8 (2009-04-27)\n================\n\n - Make it possible to set additional options per process in the control script.\n [nkryptic]\n\n0.7 (2009-01-27)\n================\n\n - Added 'plugins' option so we can install extra eggs (supervisor plugins)\n [mustapha]\n\n - Some fixes for eventlistner part [mustapha]\n\n - Updated tests\n\n0.6 (2008-11-10)\n================\n\n - One can now specify the user account that will be used as the account \n which runs the program.\n [amos]\n\n0.5 (2008-08-23)\n================\n\n - Adding eventlistners option for use as event notification framework. \n Targetting use with supervisor's memmon event listener\n [aburkhalter]\n \n0.4 (2008-06-12)\n================\n\n - Use dynamic script names to allow multiple cluster\n [gawel]\n\n - Ensure that the log dir is created when used without zope's recipes\n [gawel]\n\n\n0.3 (2008-06-01)\n================\n\n - Updated docs and tests\n [mustapha]\n \n - pep8 cosmetics\n [mustapha]\n\n - Make it possible to pass in arguments to the control script.\n [hannosch]\n\n - Put all specified options, like server url and username into the generated\n control script. This allows to run it as is.\n [hannosch]\n\n0.2 (2008-04-23)\n================\n\n - Make possible to pass arguments to the command so one can use ctl scripts\n with supervisor with arguments like 'fg' for zope instances or --no-detach \n or something similar for other programs\n [mustapha]\n\n - updated tests\n [mustapha]\n\n0.1 (2008-04-21)\n================\n\n - Created recipe with ZopeSkel [Mustapha Benali].\n\nDetailed Documentation\n**********************\n\nThis recipe when used will do the following:\n\n * install ``supervisor`` and all its dependecies.\n\n * generates the supervisord, supervisorctl, and memmon scripts in the bin \n directory \n\n * generates a configuration file to be used by supervisord and supervisorctl\n scripts\n\nSupported options\n=================\n\nThe recipe supports the following options:\n\nsections\n List of enabled supervisor sections.\n Defaults to \"http ctl rpc\"\n\nplugins\n Extra eggs you want the recipe to install. ie: superlance\n \nhttp-socket\n \"inet\" or \"unix\" socket to use for http administration. Defaults to \"inet\".\n\nfile\n A path to a UNIX domain socket (e.g. /tmp/supervisord.sock) on which\n supervisor will listen for HTTP/XML-RPC requests.\n\nchmod\n Change the UNIX permission mode bits of the UNIX domain socket to this value at startup.\n\nport\n The port nummber supervisord listen to. ie: 9001. Can be given as host:port\n like 127.0.0.1:9001. Defaults to 127.0.0.1:9001\n\nuser\n The username required for authentication to supervisord\n\npassword\n The password required for authentication to supervisord\n\nsupervisord-conf\n Full path to where the recipe puts the supervisord configuration file. \n Defaults to ${buildout:directory}/parts/${name}/supervisord.conf\n\nchildlogdir\n The full path of the directory where log files of processes managed by\n Supervisor while be stored. Defaults to ${buildout:directory}/var/log\n\nlogfile\n The full path to the supervisord log file. Defaults to \n ${buildout:directory}/var/log/supervisord.log\n\npidfile\n The pid file of supervisord. Defaults to \n ${buildout:directory}/var/supervisord.pid\n\nlogfile-maxbytes\n The maximum number of bytes that may be consumed by the activity log file \n before it is rotated. Defaults to 50MB\n\nlogfile-backups\n The number of backups to keep around resulting from activity log file \n rotation. Defaults to 10\n\nloglevel\n The logging level. Can be one of critical, error, warn, info, debug, trace, \n or blather. Defaults to info\n\numask\n The umask of the supervisord process. Defaults to 022.\n\nnodaemon\n If true, supervisord will start in the foreground instead of daemonizing.\n Defaults to false\n\nnocleanup\n Prevent supervisord from clearing any existing AUTO child log files at\n startup time. Useful for debugging. Defaults to false\n\nserverurl\n The URL that should be used to access the supervisord server. Defaults to\n http://127.0.0.1:9001\n\nprograms\n A list of programs you want the supervisord to control. One per line. \n The format of a line is as follow:\n \n priority process_name [(process_opts)] command [[args] [directory] [[redirect_stderr]]\n [user]]\n \n The [args] is any number of arguments you want to pass to the ``command``\n It has to be given between [] (ie.: [-v fg]). See examples below.\n If not given the redirect_stderr defaults to false.\n If not given the directory option defaults to the directory containing the\n the command.\n The optional process_opts argument sets additional options on the proccess\n in the supervisord configuration. \n It has to be given between ``()`` and must contain options in ``key=value`` format\n with spaces only for separating options - ie.: (autostart=false startsecs=10).\n The optional user argument gives the userid that the process should be run\n as (if supervisord is run as root).\n\n In most cases you will only need to give the 4 first parts:\n\n priority process_name command [[args]]\n\neventlisteners\n A list of eventlisteners you'd like supervisord to run as subprocesses to\n subscribe to event notifications. One per line. Relevant supervisor \n documentation about events at \n http://supervisord.org/manual/current/events.html.\n \n processname events command [[args]]\n \n ``events`` is a comma-separated list (without spaces) of event type names \n that the listener is \"interested\" in receiving notifications for.\n \n Supervisor provides one event listener called memmon which can be used to\n restart supervisord child process once they reach a certain memory limit.\n Note that you need to define the variables ``user``, ``password`` and ``serverurl``\n (described in the supported options above) to be able to use the memmon listener.\n An example of defining a memmon event listener, which analyzes memory usage \n every 60 seconds and restarts as needed could look like:\n \n MemoryMonitor TICK_60 ${buildout:bin-directory}/memmon [-p process_name=200MB]\n \ngroups\n A list of programs that become part of a group. One per line.\n The format of a line is as follow:\n \n priority group_name program_names\n \n The programs_name is a comma-separated list of program names.\n \nenv-path\n The environment variable PATH, e.g. /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin\n\n\nExample usage\n=============\n\nWe'll start by creating a buildout that uses the recipe::\n\n >>> write('buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = supervisor\n ... index = http://pypi.python.org/simple\n ... [zeo]\n ... location = /a/b/c\n ... [instance1]\n ... location = /e/f\n ... [instance2]\n ... location = /g/h\n ...\n ... [supervisor]\n ... recipe = fourdigits.recipe.supervisor\n ... plugins =\n ... superlance\n ... port = 9001\n ... user = mustapha\n ... password = secret\n ... serverurl = http://supervisor.mustap.com\n ... programs =\n ... 10 zeo ${zeo:location}/bin/runzeo ${zeo:location}\n ... 20 instance1 ${instance1:location}/bin/runzope ${instance1:location} true\n ... 30 instance2 (autostart=false) ${instance2:location}/bin/runzope true\n ... 40 maildrophost ${buildout:bin-directory}/maildropctl true\n ... 50 other ${buildout:bin-directory}/other [-n 100] /tmp\n ... 60 other2 ${buildout:bin-directory}/other2 [-n 100] true\n ... 70 other3 (startsecs=10) ${buildout:bin-directory}/other3 [-n -h -v --no-detach] /tmp3 true www-data\n ... eventlisteners =\n ... Memmon TICK_60 ${buildout:bin-directory}/memmon [-p instance1=200MB]\n ... HttpOk TICK_60 ${buildout:bin-directory}/httpok [-p site1 -t 20 http://localhost:8080/]\n ... groups =\n ... 10 services zeo,instance1\n ... 20 others other,other2,other3\n ... \"\"\")\n\nChris Mc Donough said::\n\n Note however that the \"instance\" script Plone uses to start Zope when\n passed \"fg\" appears to use os.system, so the process that supervisor is \n controlling isnt actually Plone, it's the controller script. This means \n that \"stop\" and \"start\" tend to not do what you want. It's far better to \n use \"runzope\", which actually execs the Python process which becomes Zope\n See also \n http://supervisord.org/manual/current/subprocesses.html#nondaemonizing_of_subprocesses\n\nRunning the buildout gives us::\n\n >>> print system(buildout)\n Getting distribution for 'zc.recipe.egg'.\n ...\n Installing supervisor.\n ...\n Generated script '/sample-buildout/bin/supervisorctl'.\n \n\nCheck that we have the 'crashmail', 'memmon' and 'httpok' scripts from superlance::\n\n >>> ls(sample_buildout, 'bin')\n - buildout\n - crashmail\n - httpok\n - memmon\n - supervisorctl\n - supervisord\n \n\nYou can now just run the supervisord like this::\n\n $ bin/supervisord\n\nand control it with supervisorctl::\n\n $ bin/supervisorctl\n\nMemory monitoring via supervisor's memmon event listener will be executed via\nsupervisord with the following::\n\n $ bin/memmon\n\nnow, get a look to the generated supervisord.conf file::\n\n >>> cat('parts', 'supervisor', 'supervisord.conf') #doctest: +REPORT_NDIFF\n \n [supervisord]\n childlogdir = /sample-buildout/var/log\n logfile = /sample-buildout/var/log/supervisord.log\n logfile_maxbytes = 50MB\n logfile_backups = 10\n loglevel = info\n pidfile = /sample-buildout/var/supervisord.pid\n umask = 022\n nodaemon = false\n nocleanup = false\n \n [inet_http_server]\n port = 9001\n username = mustapha\n password = secret\n \n [supervisorctl]\n serverurl = http://supervisor.mustap.com\n username = mustapha\n password = secret\n \n [rpcinterface:supervisor]\n supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface\n \n [program:zeo]\n command = /a/b/c/bin/runzeo \n process_name = zeo\n directory = /a/b/c\n priority = 10\n redirect_stderr = false\n \n \n [program:instance1]\n command = /e/f/bin/runzope \n process_name = instance1\n directory = /e/f\n priority = 20\n redirect_stderr = true\n \n \n [program:instance2]\n command = /g/h/bin/runzope \n process_name = instance2\n directory = /g/h/bin\n priority = 30\n redirect_stderr = true\n autostart = false\n \n [program:maildrophost]\n command = /sample-buildout/bin/maildropctl \n process_name = maildrophost\n directory = /sample-buildout/bin\n priority = 40\n redirect_stderr = true\n \n \n [program:other]\n command = /sample-buildout/bin/other -n 100\n process_name = other\n directory = /tmp\n priority = 50\n redirect_stderr = false\n \n \n [program:other2]\n command = /sample-buildout/bin/other2 -n 100\n process_name = other2\n directory = /sample-buildout/bin\n priority = 60\n redirect_stderr = true\n \n \n [program:other3]\n command = /sample-buildout/bin/other3 -n -h -v --no-detach\n process_name = other3\n directory = /tmp3\n priority = 70\n redirect_stderr = true\n user = www-data\n startsecs = 10\n \n [eventlistener:Memmon]\n command = /sample-buildout/bin/memmon -p instance1=200MB\n events = TICK_60\n process_name=Memmon\n environment=SUPERVISOR_USERNAME='mustapha',SUPERVISOR_PASSWORD='secret',SUPERVISOR_SERVER_URL='http://supervisor.mustap.com'\n \n [eventlistener:HttpOk]\n command = /sample-buildout/bin/httpok -p site1 -t 20 http://localhost:8080/\n events = TICK_60\n process_name=HttpOk\n environment=SUPERVISOR_USERNAME='mustapha',SUPERVISOR_PASSWORD='secret',SUPERVISOR_SERVER_URL='http://supervisor.mustap.com'\n \n [group:services]\n programs = zeo,instance1\n priority = 10\n \n [group:others]\n programs = other,other2,other3\n priority = 20\n\n\nand if we look to generated supervisord script we will see that the \nconfiguration file is given as argument with the '-c' option::\n\n >>> cat('bin', 'supervisord')\n ...\n \n ...\n \n import sys; sys.argv.extend([\"-c\",\"/sample-buildout/parts/supervisor/supervisord.conf\"])\n \n import supervisor.supervisord\n \n if __name__ == '__main__':\n supervisor.supervisord.main()\n\nThe control script contains all specified options, like server url and \nusername. This allows to run it as is::\n\n >>> cat('bin', 'supervisorctl')\n ...\n \n ...\n \n import sys; sys.argv[1:1] = [\"-c\",\"/sample-buildout/parts/supervisor/supervisord.conf\"]\n \n import supervisor.supervisorctl\n \n if __name__ == '__main__':\n supervisor.supervisorctl.main(sys.argv[1:])\n\nMemmon delegates all work to the egg's memmon Python script itself::\n\n >>> cat('bin', 'memmon')\n ...\n \n ...\n \n import superlance.memmon\n \n if __name__ == '__main__':\n superlance.memmon.main()\n\nThe log directory is created by the recipe::\n\n >>> ls(sample_buildout, 'var')\n d log\n\nYou can also specify a custom port to run the supervisor on, and the control\nscript will automatically try to connect to the specified port:\n\n >>> write('buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = supervisor\n ... index = http://pypi.python.org/simple/\n ...\n ... [supervisor]\n ... recipe = fourdigits.recipe.supervisor\n ... port = 9005\n ... programs =\n ... 50 other ${buildout:bin-directory}/other [-n 100] /tmp\n ... \"\"\")\n\nHere we specified that the supervisor will be launched on port 9005. We can see\nthat this is also set in the control script:\n\n >>> _ = system(buildout)\n >>> cat('bin', 'supervisorctl')\n ...\n \n ...\n \n import sys; sys.argv[1:1] = [\"-c\",\"/sample-buildout/parts/supervisor/supervisord.conf\"]\n \n import supervisor.supervisorctl\n \n if __name__ == '__main__':\n supervisor.supervisorctl.main(sys.argv[1:])\n\nIt is possible to run http server through `unix socket\n`_ rather than tcp:\n\n >>> write('buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = supervisor\n ... index = http://pypi.python.org/simple/\n ...\n ... [supervisor]\n ... recipe = fourdigits.recipe.supervisor\n ... http-socket = unix\n ... user = foobar\n ... password = foobar\n ... file = /tmp/supervisor.sock\n ... programs =\n ... 50 other ${buildout:bin-directory}/other [-n 100] /tmp\n ... \"\"\")\n >>> _ = system(buildout)\n >>> cat('parts', 'supervisor', 'supervisord.conf') #doctest: +REPORT_NDIFF\n \n ...\n \n [unix_http_server]\n file = /tmp/supervisor.sock\n username = foobar\n password = foobar\n chmod = 0700\n \n [supervisorctl]\n serverurl = unix:///tmp/supervisor.sock\n username = foobar\n password = foobar\n \n ...\n \n\nContributors\n************\n\n- Mustapha Benali, Author\n- Hanno Schlichting, Contributor\n- gawel, Contributor\n- aburkhalter, Contributor\n- Amos Latteier, Contributor\n- Jacob Radford, Contributor\n- Jonathan Ballet, Contributor\n- Domen Kozar, Contributor\n- Lucie Lejard, Contributor\n- Servilio Afre Puentes, Contributor\n- Juan A. Diaz (nueces), Contributor\n\nDownload\n********", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/fourdigits.recipe.supervisor", "keywords": "buildout recipe supervisor", "license": "ZPL", "maintainer": null, "maintainer_email": null, "name": "fourdigits.recipe.supervisor", "package_url": "https://pypi.org/project/fourdigits.recipe.supervisor/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/fourdigits.recipe.supervisor/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/fourdigits.recipe.supervisor" }, "release_url": "https://pypi.org/project/fourdigits.recipe.supervisor/0.18dev/", "requires_dist": null, "requires_python": null, "summary": "A buildout recipe to install supervisor", "version": "0.18dev" }, "last_serial": 792129, "releases": { "0.18dev": [ { "comment_text": "", "digests": { "md5": "f0f9e1ed7e82a7eb7dacc21cf59c0dcb", "sha256": "2a572533034df875a4f7b719016712e7196716edbf66cfdb8ac2421f6714c071" }, "downloads": -1, "filename": "fourdigits.recipe.supervisor-0.18dev.tar.gz", "has_sig": false, "md5_digest": "f0f9e1ed7e82a7eb7dacc21cf59c0dcb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13685, "upload_time": "2012-01-17T13:27:16", "url": "https://files.pythonhosted.org/packages/21/11/90e40b18e1ebf571c8b483d9aeb1f4996e3d50c97c7be5315e1e14da233e/fourdigits.recipe.supervisor-0.18dev.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f0f9e1ed7e82a7eb7dacc21cf59c0dcb", "sha256": "2a572533034df875a4f7b719016712e7196716edbf66cfdb8ac2421f6714c071" }, "downloads": -1, "filename": "fourdigits.recipe.supervisor-0.18dev.tar.gz", "has_sig": false, "md5_digest": "f0f9e1ed7e82a7eb7dacc21cf59c0dcb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13685, "upload_time": "2012-01-17T13:27:16", "url": "https://files.pythonhosted.org/packages/21/11/90e40b18e1ebf571c8b483d9aeb1f4996e3d50c97c7be5315e1e14da233e/fourdigits.recipe.supervisor-0.18dev.tar.gz" } ] }