{ "info": { "author": "Kevin Conway", "author_email": "kevinjacobconway@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "=======\nDaemons\n=======\n\n**Well behaved unix daemons for every occasion.**\n\nProject Status\n==============\n\n*Consider this project to be in maintenance mode*.\n\nThis project went v1.0.0 in 2014. Since then it has only received two patches\nthat contained code changes. All other patches have been maintenance updates\nto keep automated testing and static analysis running. I do not expect and am\nnot entertaining new feature asks.\n\nI will still respond to PRs and issues that address bugs or security issues.\nPlease send these to https://github.com/kevinconway/daemons.\n\nWhat Is Daemons?\n================\n\n`Daemons` is a resource library for Python developers that want to create\ndaemon processes. The classes in this library provide the basic daemonization,\nsignal handling, and pid management functionality while allowing for any\nimplementation of behaviour and logic.\n\nExample Custom Daemon\n=====================\n\n.. code-block:: python\n\n import time\n\n from daemons.prefab import run\n\n class SleepyDaemon(run.RunDaemon):\n\n def run(self):\n\n while True:\n\n time.sleep(1)\n\nNow to create a simple init script which can launch the daemon.\n\n.. code-block:: python\n\n #!/usr/bin/env python\n\n import logging\n import os\n import sys\n import time\n\n from mypackage import SleepyDaemon\n\n\n if __name__ == '__main__':\n\n action = sys.argv[1]\n logfile = os.path.join(os.getcwd(), \"sleepy.log\")\n pidfile = os.path.join(os.getcwd(), \"sleepy.pid\")\n\n logging.basicConfig(filename=logfile, level=logging.DEBUG)\n d = SleepyDaemon(pidfile=pidfile)\n\n if action == \"start\":\n\n d.start()\n\n elif action == \"stop\":\n\n d.stop()\n\n elif action == \"restart\":\n\n d.restart()\n\nThere are more daemon types than the simple RunDaemon. Check the docs for more.\n\nWrapping Existing Code\n======================\n\nDaemons can also be used to daemonize an arbitrary Python function.\n\n.. code-block:: python\n\n import time\n\n from daemons import daemonizer\n\n @daemonizer.run(pidfile=\"/tmp/sleepy.pid\")\n def sleepy(sleep_time):\n\n while True:\n\n time.sleep(sleep_time)\n\n sleepy(20) # Daemon started with 20 second sleep time.\n\nThe daemonizer also supports adding signal handlers. Check the docs for more.\n\nDaemon Functionality\n====================\n\nThe daemons in the 'prefab' module come bundled with the following features:\n\n- pidfile management\n- signal handling\n- start/stop/restart functionality\n- unix process daemonization\n\nThe default implementation of these feature are all driven by Python standard\nlibrary modules. Each component may be overridden or extended by adding another\nbase class to your daemon that implements the component interface. Check the\n'interfaces' package for items to implement.\n\nThe 'prefab' daemons come in three flavors. The 'RunDaemon' requires that you\nimplement the 'run' method which should use some form of a loop. If the 'run'\nmethod completes the process will stop. The 'StepDaemon' requires that you\nimplement the 'step' method. The process will call 'step' on an infinite loop.\nThe eventlet and gevent message daemons require that you implement the\n'get_message' and 'handle_message' methods. These will fetch and handle\nmessages within green-threads.\n\nLicense\n=======\n\n::\n\n Copyright 2013 Kevin Conway\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n\nContributing\n============\n\nAll contributions to this project are protected under the agreement found in\nthe `CONTRIBUTING` file. All contributors should read the agreement but, as\na summary::\n\n You give us the rights to maintain and distribute your code and we promise\n to maintain an open source distribution of anything you contribute.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kevinconway/daemons", "keywords": "", "license": "'Apache License 2.0", "maintainer": "", "maintainer_email": "", "name": "daemons", "package_url": "https://pypi.org/project/daemons/", "platform": "", "project_url": "https://pypi.org/project/daemons/", "project_urls": { "Homepage": "https://github.com/kevinconway/daemons" }, "release_url": "https://pypi.org/project/daemons/1.3.1/", "requires_dist": null, "requires_python": "", "summary": "Well behaved unix daemons for every occasion.", "version": "1.3.1" }, "last_serial": 5725636, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "85aab737aff232330bced5da585a2392", "sha256": "f751be6f38f4ba31c48f135927499471cdd434b6942d1254ef447c5f8c637149" }, "downloads": -1, "filename": "daemons-0.2.0.tar.gz", "has_sig": false, "md5_digest": "85aab737aff232330bced5da585a2392", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17644, "upload_time": "2013-12-23T11:52:33", "url": "https://files.pythonhosted.org/packages/4c/f8/0a8348b3c3ba7bd66040d07f16b058fddbbeec822cc5c1b6d89d4dccd938/daemons-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "697f16e0a268aa74ca092dd2ce9f5710", "sha256": "fa5da04820a73ee63349db01fb18f2088d1f6d90cc38f342dcd5d82718422a74" }, "downloads": -1, "filename": "daemons-0.2.1.tar.gz", "has_sig": false, "md5_digest": "697f16e0a268aa74ca092dd2ce9f5710", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17639, "upload_time": "2014-01-08T13:51:53", "url": "https://files.pythonhosted.org/packages/b2/09/d9fe42fe85e308765a44ef8d66e6714d235feb1aba581d2f9fb4f4a21d89/daemons-0.2.1.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "8c969c421d1106ad037b449baf501ba7", "sha256": "210e714cdf6a390c3301780cd236d12c63196e64bffbe5481877d5109561b79d" }, "downloads": -1, "filename": "daemons-1.2.1.tar.gz", "has_sig": false, "md5_digest": "8c969c421d1106ad037b449baf501ba7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18646, "upload_time": "2014-11-11T08:14:58", "url": "https://files.pythonhosted.org/packages/a5/59/bb14f3bfdfccf3b811503afcf35e1c90f2d0a968d05a9b19345e8de5bf3b/daemons-1.2.1.tar.gz" } ], "1.2.2": [ { "comment_text": "", "digests": { "md5": "643815eceb69f076823d102ad97a3dbd", "sha256": "df14a6abd66513a026e1695a58973adfe0808ae2cf195c608a7a5c46f9f48be2" }, "downloads": -1, "filename": "daemons-1.2.2.tar.gz", "has_sig": false, "md5_digest": "643815eceb69f076823d102ad97a3dbd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14450, "upload_time": "2015-11-28T02:32:21", "url": "https://files.pythonhosted.org/packages/ff/80/9839a31bf77290689be534b1bfd7acabf242159f20e6bd19e98790f14061/daemons-1.2.2.tar.gz" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "61efe04d47400db20d9908ad6033f0ac", "sha256": "8e93b8927d258e74ba7865fc662f403b35532a1dd6e833e57a703b533b421288" }, "downloads": -1, "filename": "daemons-1.3.0.tar.gz", "has_sig": false, "md5_digest": "61efe04d47400db20d9908ad6033f0ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17704, "upload_time": "2017-01-05T01:37:23", "url": "https://files.pythonhosted.org/packages/4c/06/839e9057afe8f6b0add5b93982ddd945dfb04706645edb89ceff0d7155b4/daemons-1.3.0.tar.gz" } ], "1.3.1": [ { "comment_text": "", "digests": { "md5": "f1fff8c79054080fba85039ccd090ea8", "sha256": "845c22084661f639c6a4652106cb839bc1cbc66834eebbc97b76fbfe4edd01a2" }, "downloads": -1, "filename": "daemons-1.3.1-py2-none-any.whl", "has_sig": false, "md5_digest": "f1fff8c79054080fba85039ccd090ea8", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 21182, "upload_time": "2019-08-25T00:06:39", "url": "https://files.pythonhosted.org/packages/19/ed/ddc96943cfa421d370763a470c50387e4d6eaf55deaa417c7151022afdb8/daemons-1.3.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0618bba96b80e25f51eb085625067a54", "sha256": "973ab274919ef662fb35cd9103990c1fd672b7b2b62dc3c40ef21e2a98a22f4f" }, "downloads": -1, "filename": "daemons-1.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "0618bba96b80e25f51eb085625067a54", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 21181, "upload_time": "2019-08-25T00:06:40", "url": "https://files.pythonhosted.org/packages/6d/75/e6913727b5fb46669b95dbe50c1bfbd80cfed6cdad05ae949dcffcb2b0a1/daemons-1.3.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f9e13cb04b17e401cbf845fa42071726", "sha256": "49e7a9cad5c7c06f88af95fa0dba299e1c0d3d911f1512b203dd20f5e74b6cea" }, "downloads": -1, "filename": "daemons-1.3.1.tar.gz", "has_sig": false, "md5_digest": "f9e13cb04b17e401cbf845fa42071726", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16062, "upload_time": "2019-08-25T00:06:42", "url": "https://files.pythonhosted.org/packages/75/63/b88093e8d62492e93eadd8126c422abe302e6413de7ee5eaab2157233ecd/daemons-1.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f1fff8c79054080fba85039ccd090ea8", "sha256": "845c22084661f639c6a4652106cb839bc1cbc66834eebbc97b76fbfe4edd01a2" }, "downloads": -1, "filename": "daemons-1.3.1-py2-none-any.whl", "has_sig": false, "md5_digest": "f1fff8c79054080fba85039ccd090ea8", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 21182, "upload_time": "2019-08-25T00:06:39", "url": "https://files.pythonhosted.org/packages/19/ed/ddc96943cfa421d370763a470c50387e4d6eaf55deaa417c7151022afdb8/daemons-1.3.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0618bba96b80e25f51eb085625067a54", "sha256": "973ab274919ef662fb35cd9103990c1fd672b7b2b62dc3c40ef21e2a98a22f4f" }, "downloads": -1, "filename": "daemons-1.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "0618bba96b80e25f51eb085625067a54", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 21181, "upload_time": "2019-08-25T00:06:40", "url": "https://files.pythonhosted.org/packages/6d/75/e6913727b5fb46669b95dbe50c1bfbd80cfed6cdad05ae949dcffcb2b0a1/daemons-1.3.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f9e13cb04b17e401cbf845fa42071726", "sha256": "49e7a9cad5c7c06f88af95fa0dba299e1c0d3d911f1512b203dd20f5e74b6cea" }, "downloads": -1, "filename": "daemons-1.3.1.tar.gz", "has_sig": false, "md5_digest": "f9e13cb04b17e401cbf845fa42071726", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16062, "upload_time": "2019-08-25T00:06:42", "url": "https://files.pythonhosted.org/packages/75/63/b88093e8d62492e93eadd8126c422abe302e6413de7ee5eaab2157233ecd/daemons-1.3.1.tar.gz" } ] }