{ "info": { "author": "Andrey Kulikov", "author_email": "amdeich@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: No Input/Output (Daemon)", "Intended Audience :: Developers", "License :: OSI Approved :: Attribution Assurance License", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX :: Linux", "Operating System :: Unix", "Programming Language :: Python :: 2.4", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries" ], "description": "Python daemonizer class\n====================\n\nThis is a Python class that will daemonize your Python script so it can continue running in the background. It works on Unix, Linux and OS X, creates a PID file and has standard commands (start, stop, restart) + a foreground mode.\n\nBased on [this original version from jejik.com](http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/).\n\nUsage\n---------------------\n\nDefine a class which inherits from `Daemon` and has a `run()` method (which is what will be called once the daemonization is completed.\n\n\tfrom daemon import Daemon\n\t\n\tclass pantalaimon(Daemon):\n\t\tdef run(self):\n\t\t\t# Do stuff\n\t\t\t\nCreate a new object of your class, specifying where you want your PID file to exist:\n\n\tpineMarten = pantalaimon('/path/to/pid.pid')\n\tpineMarten.start()\n\nActions\n---------------------\n\n* `start()` - starts the daemon (creates PID and daemonizes).\n* `stop()` - stops the daemon (stops the child process and removes the PID).\n* `restart()` - does `stop()` then `start()`.\n\nForeground\n---------------------\n\nThis is useful for debugging because you can start the code without making it a daemon. The running script then depends on the open shell like any normal Python script.\n\nTo do this, just call the `run()` method directly.\n\n\tpineMarten.run()\n\nContinuous execution\n---------------------\n\nThe `run()` method will be executed just once so if you want the daemon to be doing stuff continuously you may wish to use the [sched][1] module to execute code repeatedly ([example][2]).\n\n\n [1]: http://docs.python.org/library/sched.html\n [2]: https://github.com/serverdensity/sd-agent/blob/master/agent.py#L339", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/serverdensity/python-daemon", "keywords": null, "license": "http://creativecommons.org/licenses/by-sa/3.0/", "maintainer": null, "maintainer_email": null, "name": "py_daemon", "package_url": "https://pypi.org/project/py_daemon/", "platform": "any", "project_url": "https://pypi.org/project/py_daemon/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/serverdensity/python-daemon" }, "release_url": "https://pypi.org/project/py_daemon/0.1.2/", "requires_dist": null, "requires_python": null, "summary": "Python daemonizer for Unix, Linux and OS X", "version": "0.1.2" }, "last_serial": 2361762, "releases": { "0.1.0": [], "0.1.1": [ { "comment_text": "", "digests": { "md5": "0fb6ec9b4a6896598a47b5bffc53f2ca", "sha256": "f0a576b70b1802400177056aad13e22f21bf2bb6ef8c69627a9d1887025c15f8" }, "downloads": -1, "filename": "py_daemon-0.1.1-py2.7.egg", "has_sig": false, "md5_digest": "0fb6ec9b4a6896598a47b5bffc53f2ca", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 8464, "upload_time": "2016-09-24T20:29:26", "url": "https://files.pythonhosted.org/packages/79/ba/72438b9347663fa42291bd4603a2e67e36d3cf8961e6f1e69715fac070e4/py_daemon-0.1.1-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "547e1da614ca88b1300ca0fa01ec5042", "sha256": "edb1ba26ef071f8e37a68b6953d16ba40a50d466efd8ef235f05bf5d44c6bb5e" }, "downloads": -1, "filename": "py_daemon-0.1.1.tar.gz", "has_sig": false, "md5_digest": "547e1da614ca88b1300ca0fa01ec5042", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4987, "upload_time": "2016-09-24T20:28:10", "url": "https://files.pythonhosted.org/packages/70/9f/49299cdcb2f4eec4768fa7d463f107ac32033541f7827c48861706a5cb86/py_daemon-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "b8ff3193facdf4be4a89a61412f41b9d", "sha256": "8ec590ab420c56223c41099883be8ba27576b5bd7b07a9effeb717263e5e49f0" }, "downloads": -1, "filename": "py_daemon-0.1.2-py2.7.egg", "has_sig": false, "md5_digest": "b8ff3193facdf4be4a89a61412f41b9d", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 7695, "upload_time": "2016-09-24T20:47:38", "url": "https://files.pythonhosted.org/packages/51/d7/06be1f53d3e3363fe75279b15d3d8a7972e1622d9b2f55000a8e3d6b83df/py_daemon-0.1.2-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "c22c0f1f778d75b0712e7ad655e9165e", "sha256": "8dc5aa09650c11be42931e7fec4dda96245ece214233d259743fba153a87f287" }, "downloads": -1, "filename": "py_daemon-0.1.2.tar.gz", "has_sig": false, "md5_digest": "c22c0f1f778d75b0712e7ad655e9165e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4307, "upload_time": "2016-09-24T20:47:56", "url": "https://files.pythonhosted.org/packages/97/44/14be0149111e8b5c520d9597fcaca9036d3e5cb646132eacb655e4b5344a/py_daemon-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b8ff3193facdf4be4a89a61412f41b9d", "sha256": "8ec590ab420c56223c41099883be8ba27576b5bd7b07a9effeb717263e5e49f0" }, "downloads": -1, "filename": "py_daemon-0.1.2-py2.7.egg", "has_sig": false, "md5_digest": "b8ff3193facdf4be4a89a61412f41b9d", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 7695, "upload_time": "2016-09-24T20:47:38", "url": "https://files.pythonhosted.org/packages/51/d7/06be1f53d3e3363fe75279b15d3d8a7972e1622d9b2f55000a8e3d6b83df/py_daemon-0.1.2-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "c22c0f1f778d75b0712e7ad655e9165e", "sha256": "8dc5aa09650c11be42931e7fec4dda96245ece214233d259743fba153a87f287" }, "downloads": -1, "filename": "py_daemon-0.1.2.tar.gz", "has_sig": false, "md5_digest": "c22c0f1f778d75b0712e7ad655e9165e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4307, "upload_time": "2016-09-24T20:47:56", "url": "https://files.pythonhosted.org/packages/97/44/14be0149111e8b5c520d9597fcaca9036d3e5cb646132eacb655e4b5344a/py_daemon-0.1.2.tar.gz" } ] }