{ "info": { "author": "UNKNOWN", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [], "description": "lockex\n======\n\nlockex is a tool that attempts to acquire a lock from zookeeper prior\nto executing a user supplied command.\n\nIf lockex cannot aquire a lock, it will block, wait and retry to acquire\nthe lock. Alernatively instead of blocking, lockex can exit after a given\ntimeout or immediately. The lock id is generated automatically based on\nuser supplied command. We also assume that the user command that is to\nbe run, is executed in the foreground.\n\nBy default if the concurrency is set it 1, lockex will try and get lock,\nif the concurrency is greater than 1 then lockex will try to acquire a\nlock via a semaphore.\n\nlockex will die if the connection to zookeeper is lost, it will continue\nto run if the connection is suspended. lockex will do it's best to\ncleanup the child process when this happens.\n\nLicense\n-------\n\nPlease see COPYING\n\nUse cases:\n----------\n\n* You have a producer/consumer based daemons, you can only run one\nproducer at a time. *lockex* will let you startup many producers but\nonly one will run if it has acquired a lock.\n\n* A long running cronjob and you want to guarantee that it runs on only\non one host assuming the jobs all start within a small time window.\n\n\nInstallation:\n-------------\n\n pip install https://github.com/rapid7/lockex\n\n\nUsage:\n------\n\nRunning *lockex --help* will give you information about how to use\nthe application. In general,\n\n lockex OPTIONS -- your_command your_args\n\n*lockex* will treat anything after the '--' as the command that you want\nto run. *lockex* will also look for the ZKHOSTS environment variable\nto connect to your zookeeper cluster, the format is a comma seperated\nlist of 'hostname:port'.\n\n\nExample:\n--------\n\nAssuming redis did not have a master/slave capability and you are using\nsupervisord to run your processes.\n\nOn host1, you have a single redis instance running (assuming the data\nis stored in a shared location)\n\n lockex -- /usr/local/bin/redis-server /etc/redis.conf\n\nOn host2, you have an identical configuration (with access to the data\nin the shared location), run the same command as on host1\n\n lockex -- /usr/local/bin/redis-server /etc/redis.conf\n\nIf and when host1's instance redis dies, host2 will acquire the lock\nfrom zookeeper and startup redis. In a controlled example send host1's\nlockex instance with a SIGTERM and it will kill it's child processes.\n\n\nRequirements:\n-------------\n\n* A working installation of zookeeper and python2.7 or higher.\n* A durable instance of zookeeper (at least three nodes).\n* The hosts are all synchronised with ntp.\n\nVendored packages:\n------------------\n\n* lockex/glog.py - https://github.com/benley/python-glog - Copyright (c) 2015 Benjamin Staffin - under 2 clause BSD license.\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "lockex", "package_url": "https://pypi.org/project/lockex/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/lockex/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/lockex/0.3/", "requires_dist": null, "requires_python": null, "summary": "Get lock from zookeeper and execute", "version": "0.3" }, "last_serial": 2106841, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "bde4f4d0635ef7cbafc9c421427d7308", "sha256": "fd92141f29dfe77dcb92109b1ae1ff7d6a13df095c1c40993e1851a607581e3a" }, "downloads": -1, "filename": "lockex-0.1.tar.gz", "has_sig": false, "md5_digest": "bde4f4d0635ef7cbafc9c421427d7308", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9493, "upload_time": "2016-04-29T14:21:21", "url": "https://files.pythonhosted.org/packages/af/1e/aa64189141b8d69d7e441380da3ecc47403615cf966d4a99191212d0ace2/lockex-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "85f626bea7ca86b9ef3871aea455e0fd", "sha256": "82010f2066701b50c8ac89c227d4dea83f7e352d46cb68806d283ebdd4c508df" }, "downloads": -1, "filename": "lockex-0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "85f626bea7ca86b9ef3871aea455e0fd", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 6622, "upload_time": "2016-05-09T14:32:39", "url": "https://files.pythonhosted.org/packages/e3/7b/036356f1a38aedc9c2d148ef26e62dfe095574b49d812a6d2eebb6a7013c/lockex-0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "95ed5a19c65b76471519b8008f23c178", "sha256": "0e82950cab9ea3b047b9daf8641d3a3e36036bbd7810ece088c4031631a5c7eb" }, "downloads": -1, "filename": "lockex-0.2.tar.gz", "has_sig": false, "md5_digest": "95ed5a19c65b76471519b8008f23c178", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9487, "upload_time": "2016-05-09T14:32:18", "url": "https://files.pythonhosted.org/packages/7c/78/ce97c407bc3bd93a7c6fcecb2fd52e57b0fbbfebb484083d1ae1a4030e80/lockex-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "a0a72b482f1b77a3287b829d6fc20db9", "sha256": "240c338bd7b4f455784f4746e6b9259d2e1f0ba7e55157f8876100f585a19a68" }, "downloads": -1, "filename": "lockex-0.3-py2-none-any.whl", "has_sig": false, "md5_digest": "a0a72b482f1b77a3287b829d6fc20db9", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 6684, "upload_time": "2016-05-09T16:11:57", "url": "https://files.pythonhosted.org/packages/f5/2d/76ed9ba5d3ce7bdd7b642b171b4c3864699110b37c1364127ce5b0af1b6d/lockex-0.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ca482be28987332cbe09e6a440ef129d", "sha256": "cc71c6fe470ee510ed4063dd7ee54fc9a9a233bdad9096a38d0d02b1a08a7013" }, "downloads": -1, "filename": "lockex-0.3.tar.gz", "has_sig": false, "md5_digest": "ca482be28987332cbe09e6a440ef129d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9648, "upload_time": "2016-05-09T16:11:38", "url": "https://files.pythonhosted.org/packages/a3/59/fdd1cf3eb3ca5cd3760e4a069f9756a257dca8e7992ca36f77ccf10a6cd1/lockex-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a0a72b482f1b77a3287b829d6fc20db9", "sha256": "240c338bd7b4f455784f4746e6b9259d2e1f0ba7e55157f8876100f585a19a68" }, "downloads": -1, "filename": "lockex-0.3-py2-none-any.whl", "has_sig": false, "md5_digest": "a0a72b482f1b77a3287b829d6fc20db9", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 6684, "upload_time": "2016-05-09T16:11:57", "url": "https://files.pythonhosted.org/packages/f5/2d/76ed9ba5d3ce7bdd7b642b171b4c3864699110b37c1364127ce5b0af1b6d/lockex-0.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ca482be28987332cbe09e6a440ef129d", "sha256": "cc71c6fe470ee510ed4063dd7ee54fc9a9a233bdad9096a38d0d02b1a08a7013" }, "downloads": -1, "filename": "lockex-0.3.tar.gz", "has_sig": false, "md5_digest": "ca482be28987332cbe09e6a440ef129d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9648, "upload_time": "2016-05-09T16:11:38", "url": "https://files.pythonhosted.org/packages/a3/59/fdd1cf3eb3ca5cd3760e4a069f9756a257dca8e7992ca36f77ccf10a6cd1/lockex-0.3.tar.gz" } ] }