{ "info": { "author": "Jiangge Zhang", "author_email": "tonyseek@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Operating System :: POSIX", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities" ], "description": "orphanage\n=========\n\nLet child processes in Python suicide if they became orphans.\n\nInstallation\n------------\n\n.. code-block:: bash\n\n pip install orphanage\n\nDon't forget to put it in ``setup.py`` / ``requirements.txt``.\n\n\nUsage\n-----\n\n.. code-block:: python\n\n from orphanage import exit_when_orphaned\n\n exit_when_orphaned()\n\n\nMotivation\n----------\n\nSome application server softwares (e.g. Gunicorn_) work on a multiple-process\narchitect which we call the master-worker model. They must clean up the worker\nprocesses if the master process is stopped, to prevent them from becoming\norphan processes.\n\nIn the gevent-integration scene, the worker processes of Gunicorn poll their\n``ppid`` in an user thread (a.k.a greenlet) to be orphan-aware. But the user\nthread may be hanged once the master process crashed because of the blocked\nwriting on a pipe, the communicating channel between master process and\nworker processes.\n\nWe want to perform this ``ppid`` polling in a real kernel thread. That is the\nintent of this library.\n\n\nPrinciple\n---------\n\nThis library spawns an internal thread to poll the ``ppid`` at regular\nintervals (for now it is one second). Once the ``ppid`` changed, the original\nparent process should be dead and the current process should be orphaned. The\ninternal thread will send ``SIGTERM`` to the current process.\n\nIn the plan, the ``prctl`` & ``SIGHUP`` pattern may be introduced in Linux\nplatforms to avoid from creating threads. For now, the only supported strategy\nis the ``ppid`` polling, for being portable.\n\n\nAlternatives\n------------\n\nCaoE_ is an alternative to this library which developed by the Douban Inc. It\nuses ``prctl`` and a twice-forking pattern. It has a pure Python implementation\nwithout any C extension compiling requirement. If you don't mind to twist the\nprocess tree, that will be a good choice too.\n\n\nContributing\n------------\n\nIf you want to report bugs or request features, please feel free to open\nissues on GitHub_.\n\nOf course, pull requests are always welcome.\n\n.. _Gunicorn: https://github.com/benoitc/gunicorn\n.. _CaoE: https://github.com/douban/CaoE\n.. _GitHub: https://github.com/tonyseek/python-orphanage/issues\n\n.. |Build Status| image:: https://travis-ci.org/tonyseek/python-orphanage.svg?branch=master\n :target: https://travis-ci.org/tonyseek/python-orphanage\n :alt: Build Status\n.. |Coverage Status| image:: https://coveralls.io/repos/github/tonyseek/python-orphanage/badge.svg?branch=master\n :target: https://coveralls.io/github/tonyseek/python-orphanage?branch=master\n :alt: Coverage Status\n.. |PyPI Version| image:: https://img.shields.io/pypi/v/orphanage.svg\n :target: https://pypi.org/project/orphanage/\n :alt: PyPI Version\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/tonyseek/python-orphanage", "keywords": "process,management,orphan", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "orphanage", "package_url": "https://pypi.org/project/orphanage/", "platform": "POSIX", "project_url": "https://pypi.org/project/orphanage/", "project_urls": { "Homepage": "https://github.com/tonyseek/python-orphanage" }, "release_url": "https://pypi.org/project/orphanage/0.1.0/", "requires_dist": [ "cffi (>=1.0.0)" ], "requires_python": "", "summary": "Let orphan processes suicide", "version": "0.1.0" }, "last_serial": 3848142, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "a18550dd6b4c0637955f573cc997b47d", "sha256": "072545a0f3537d9edd751b6742549013695dfccd83e3f8e41663f08b9383844f" }, "downloads": -1, "filename": "orphanage-0.1.0-cp27-cp27m-macosx_10_13_x86_64.whl", "has_sig": true, "md5_digest": "a18550dd6b4c0637955f573cc997b47d", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 10057, "upload_time": "2018-05-09T12:10:38", "url": "https://files.pythonhosted.org/packages/c5/9e/ac7a832ab42c9303f1ab357109048543f6dcb4b11ef3f2ff954fd35a8264/orphanage-0.1.0-cp27-cp27m-macosx_10_13_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "7615280a94ca87d7914729c9c4d132ab", "sha256": "42fd846417ecd91d975b28d02d15d2e44ccd54605eb2511ff8219aa2a23b2f0f" }, "downloads": -1, "filename": "orphanage-0.1.0-cp27-cp27mu-manylinux1_x86_64.whl", "has_sig": true, "md5_digest": "7615280a94ca87d7914729c9c4d132ab", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 19658, "upload_time": "2018-05-09T12:10:40", "url": "https://files.pythonhosted.org/packages/c2/0a/3b7c291ccfc3ebf141dd1118313daae86fdfe77437b40e1c689adce0db36/orphanage-0.1.0-cp27-cp27mu-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "f6fff952c780955840463b2ef8aecae1", "sha256": "addef2e38475b23bb0b1698d831363a6b68eac3910d993d26cd4e44df6b15e6d" }, "downloads": -1, "filename": "orphanage-0.1.0-cp36-cp36m-macosx_10_13_x86_64.whl", "has_sig": true, "md5_digest": "f6fff952c780955840463b2ef8aecae1", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 10100, "upload_time": "2018-05-09T12:10:42", "url": "https://files.pythonhosted.org/packages/5a/4a/ca31ad8b3a85d31dc953a095935c4d39be66acc631a2af394dd319a8551b/orphanage-0.1.0-cp36-cp36m-macosx_10_13_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "3404c833515951424af393073e64caab", "sha256": "8d482ef8ff69fe72bf51fab9d0adbb42a08ed44cb2d68282f3e68cc6400ee47a" }, "downloads": -1, "filename": "orphanage-0.1.0-cp36-cp36m-manylinux1_x86_64.whl", "has_sig": true, "md5_digest": "3404c833515951424af393073e64caab", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 16655, "upload_time": "2018-05-09T12:10:43", "url": "https://files.pythonhosted.org/packages/e6/20/6e0310ef8ec6b3d0e1d593da3183f764651d9415848c0155c2880d142d33/orphanage-0.1.0-cp36-cp36m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "9bb7e75686e202cc8291de5d9d9c232a", "sha256": "ce39ab1f79d73aec3825817bd50d1d353cd81cecf9986c7a4060a3912905c04e" }, "downloads": -1, "filename": "orphanage-0.1.0-pp2510-pypy_41-macosx_10_13_x86_64.whl", "has_sig": true, "md5_digest": "9bb7e75686e202cc8291de5d9d9c232a", "packagetype": "bdist_wheel", "python_version": "pp2510", "requires_python": null, "size": 12277, "upload_time": "2018-05-09T12:10:44", "url": "https://files.pythonhosted.org/packages/ba/ca/c73bd3f8fb986967af3dbca6f868d0da6857d4d43bb3f812509944d34c6d/orphanage-0.1.0-pp2510-pypy_41-macosx_10_13_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "029bfdd291c78c29052dcebce8b871c0", "sha256": "0160915acc25c8bbbdb8c3a39400b9ec2325ec16608817c26e145eba1d81023b" }, "downloads": -1, "filename": "orphanage-0.1.0-pp260-pypy_41-manylinux1_x86_64.whl", "has_sig": true, "md5_digest": "029bfdd291c78c29052dcebce8b871c0", "packagetype": "bdist_wheel", "python_version": "pp260", "requires_python": null, "size": 23572, "upload_time": "2018-05-09T12:10:45", "url": "https://files.pythonhosted.org/packages/10/70/b1c4cc8459fd9f19522bacfaf7d194c2315b2db598d025eb8e885f3e9a33/orphanage-0.1.0-pp260-pypy_41-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "f8604f40c5b713b5d2a4964f0d38450b", "sha256": "26a6b1515a6c22a1cbb73c48f009914f6d12f12380bb622deb02321eb44784cf" }, "downloads": -1, "filename": "orphanage-0.1.0-pp3510-pypy3_510-macosx_10_13_x86_64.whl", "has_sig": true, "md5_digest": "f8604f40c5b713b5d2a4964f0d38450b", "packagetype": "bdist_wheel", "python_version": "pp3510", "requires_python": null, "size": 8666, "upload_time": "2018-05-09T12:10:47", "url": "https://files.pythonhosted.org/packages/3b/94/7ec0548ffdf1b5048b85b5f208cde6054387bd5093f56ea63708a51dcd04/orphanage-0.1.0-pp3510-pypy3_510-macosx_10_13_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "defc8e74720d27a19312a0a58b370717", "sha256": "f6f45325a06c71972730f0ddacfc9cb3b9b59a1910ab7d917ad7a0d26f561e02" }, "downloads": -1, "filename": "orphanage-0.1.0-pp360-pypy3_60-manylinux1_x86_64.whl", "has_sig": true, "md5_digest": "defc8e74720d27a19312a0a58b370717", "packagetype": "bdist_wheel", "python_version": "pp360", "requires_python": null, "size": 10368, "upload_time": "2018-05-09T12:10:48", "url": "https://files.pythonhosted.org/packages/21/4d/881878574dcfb03d21e20f660cf790124e2333d6e6fb26de05a908bbd87c/orphanage-0.1.0-pp360-pypy3_60-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "7cc52d80eea23a93fb67fcd864c16e57", "sha256": "f5ae69e99fcdd7996e5ed6744477b5168c01b690009b84acd88e3be178578a6a" }, "downloads": -1, "filename": "orphanage-0.1.0.tar.gz", "has_sig": true, "md5_digest": "7cc52d80eea23a93fb67fcd864c16e57", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6467, "upload_time": "2018-05-09T12:10:50", "url": "https://files.pythonhosted.org/packages/33/eb/a4b6c6120a0f61866e9aac47c98db02f8cf2e0ec19b0f21e91e669a4f991/orphanage-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a18550dd6b4c0637955f573cc997b47d", "sha256": "072545a0f3537d9edd751b6742549013695dfccd83e3f8e41663f08b9383844f" }, "downloads": -1, "filename": "orphanage-0.1.0-cp27-cp27m-macosx_10_13_x86_64.whl", "has_sig": true, "md5_digest": "a18550dd6b4c0637955f573cc997b47d", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 10057, "upload_time": "2018-05-09T12:10:38", "url": "https://files.pythonhosted.org/packages/c5/9e/ac7a832ab42c9303f1ab357109048543f6dcb4b11ef3f2ff954fd35a8264/orphanage-0.1.0-cp27-cp27m-macosx_10_13_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "7615280a94ca87d7914729c9c4d132ab", "sha256": "42fd846417ecd91d975b28d02d15d2e44ccd54605eb2511ff8219aa2a23b2f0f" }, "downloads": -1, "filename": "orphanage-0.1.0-cp27-cp27mu-manylinux1_x86_64.whl", "has_sig": true, "md5_digest": "7615280a94ca87d7914729c9c4d132ab", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 19658, "upload_time": "2018-05-09T12:10:40", "url": "https://files.pythonhosted.org/packages/c2/0a/3b7c291ccfc3ebf141dd1118313daae86fdfe77437b40e1c689adce0db36/orphanage-0.1.0-cp27-cp27mu-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "f6fff952c780955840463b2ef8aecae1", "sha256": "addef2e38475b23bb0b1698d831363a6b68eac3910d993d26cd4e44df6b15e6d" }, "downloads": -1, "filename": "orphanage-0.1.0-cp36-cp36m-macosx_10_13_x86_64.whl", "has_sig": true, "md5_digest": "f6fff952c780955840463b2ef8aecae1", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 10100, "upload_time": "2018-05-09T12:10:42", "url": "https://files.pythonhosted.org/packages/5a/4a/ca31ad8b3a85d31dc953a095935c4d39be66acc631a2af394dd319a8551b/orphanage-0.1.0-cp36-cp36m-macosx_10_13_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "3404c833515951424af393073e64caab", "sha256": "8d482ef8ff69fe72bf51fab9d0adbb42a08ed44cb2d68282f3e68cc6400ee47a" }, "downloads": -1, "filename": "orphanage-0.1.0-cp36-cp36m-manylinux1_x86_64.whl", "has_sig": true, "md5_digest": "3404c833515951424af393073e64caab", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 16655, "upload_time": "2018-05-09T12:10:43", "url": "https://files.pythonhosted.org/packages/e6/20/6e0310ef8ec6b3d0e1d593da3183f764651d9415848c0155c2880d142d33/orphanage-0.1.0-cp36-cp36m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "9bb7e75686e202cc8291de5d9d9c232a", "sha256": "ce39ab1f79d73aec3825817bd50d1d353cd81cecf9986c7a4060a3912905c04e" }, "downloads": -1, "filename": "orphanage-0.1.0-pp2510-pypy_41-macosx_10_13_x86_64.whl", "has_sig": true, "md5_digest": "9bb7e75686e202cc8291de5d9d9c232a", "packagetype": "bdist_wheel", "python_version": "pp2510", "requires_python": null, "size": 12277, "upload_time": "2018-05-09T12:10:44", "url": "https://files.pythonhosted.org/packages/ba/ca/c73bd3f8fb986967af3dbca6f868d0da6857d4d43bb3f812509944d34c6d/orphanage-0.1.0-pp2510-pypy_41-macosx_10_13_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "029bfdd291c78c29052dcebce8b871c0", "sha256": "0160915acc25c8bbbdb8c3a39400b9ec2325ec16608817c26e145eba1d81023b" }, "downloads": -1, "filename": "orphanage-0.1.0-pp260-pypy_41-manylinux1_x86_64.whl", "has_sig": true, "md5_digest": "029bfdd291c78c29052dcebce8b871c0", "packagetype": "bdist_wheel", "python_version": "pp260", "requires_python": null, "size": 23572, "upload_time": "2018-05-09T12:10:45", "url": "https://files.pythonhosted.org/packages/10/70/b1c4cc8459fd9f19522bacfaf7d194c2315b2db598d025eb8e885f3e9a33/orphanage-0.1.0-pp260-pypy_41-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "f8604f40c5b713b5d2a4964f0d38450b", "sha256": "26a6b1515a6c22a1cbb73c48f009914f6d12f12380bb622deb02321eb44784cf" }, "downloads": -1, "filename": "orphanage-0.1.0-pp3510-pypy3_510-macosx_10_13_x86_64.whl", "has_sig": true, "md5_digest": "f8604f40c5b713b5d2a4964f0d38450b", "packagetype": "bdist_wheel", "python_version": "pp3510", "requires_python": null, "size": 8666, "upload_time": "2018-05-09T12:10:47", "url": "https://files.pythonhosted.org/packages/3b/94/7ec0548ffdf1b5048b85b5f208cde6054387bd5093f56ea63708a51dcd04/orphanage-0.1.0-pp3510-pypy3_510-macosx_10_13_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "defc8e74720d27a19312a0a58b370717", "sha256": "f6f45325a06c71972730f0ddacfc9cb3b9b59a1910ab7d917ad7a0d26f561e02" }, "downloads": -1, "filename": "orphanage-0.1.0-pp360-pypy3_60-manylinux1_x86_64.whl", "has_sig": true, "md5_digest": "defc8e74720d27a19312a0a58b370717", "packagetype": "bdist_wheel", "python_version": "pp360", "requires_python": null, "size": 10368, "upload_time": "2018-05-09T12:10:48", "url": "https://files.pythonhosted.org/packages/21/4d/881878574dcfb03d21e20f660cf790124e2333d6e6fb26de05a908bbd87c/orphanage-0.1.0-pp360-pypy3_60-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "7cc52d80eea23a93fb67fcd864c16e57", "sha256": "f5ae69e99fcdd7996e5ed6744477b5168c01b690009b84acd88e3be178578a6a" }, "downloads": -1, "filename": "orphanage-0.1.0.tar.gz", "has_sig": true, "md5_digest": "7cc52d80eea23a93fb67fcd864c16e57", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6467, "upload_time": "2018-05-09T12:10:50", "url": "https://files.pythonhosted.org/packages/33/eb/a4b6c6120a0f61866e9aac47c98db02f8cf2e0ec19b0f21e91e669a4f991/orphanage-0.1.0.tar.gz" } ] }