{ "info": { "author": "Matthew Gamble", "author_email": "git@matthewgamble.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "Intended Audience :: System Administrators", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: System :: Systems Administration", "Topic :: Terminals", "Topic :: Utilities" ], "description": "Nspawn Tools\n\nThis is a small project designed to provide helper code for interacting with\nsystemd-nspawn machines. At the moment, it contains two programs. Their\ncapabilities are described below. It also contains some associated library\ncode that can be used and extended for other purposes. These are designed to\nwork with machines that are using an init system such as runit or s6-overlay\n(possibly also systemd, depending on the program).\n\nThis project is free software: you can redistribute it and/or modify it under\nthe terms of the GNU General Public License Version 3 as published by the Free\nSoftware Foundation. No other version currently applies to this project. This\nproject is distributed without any warranty. Please see LICENSE.txt for the\nfull text of the license.\n\n\nnspawn-enter\n\nThis is a wrapper for the nsenter utility from the util-linux package. Without\nthis, you would have to manually work out what the PID of the leader process\nis, then run nsenter manually and remember all the flags you need to ensure you\nenter all of the same namespaces that the leader process is running under.\n\nTo use nspawn-enter, run it like so:\n\n nspawn-enter mymachinename\n\nIt is possible to avoid entering some namespaces of the leader process. You can\npass the --no-network flag to avoid entering the network namespace. You can pass\nthe --no-pid flag to avoid entering the PID namespace. I added these to aid\ndebugging of issues within the container (especially networking issues). It can\naid things such as installing packages too. As a result, these flags are not\ngeneric. If someone wants to provide a patch to make this generic for all\nnamespace flags supported by nsenter, I will be happy to consider it.\n\n\nnspawn-stop\n\nOne of the problems I encountered while setting up systemd-nspawn containers\nrunning with init systems that aren't systemd was getting the machine to shut\ndown cleanly when running as a systemd service unit. Initially, I was excluding\nthe --keep-unit flag when running systemd-nspawn in the ExecStart line of the\nunit, and using 'machinectl kill mymachinename --kill-who=leader' as the\nExecStop line. Unfortunately, this still resulted in the ungraceful termination\nof all processes within the container.\n\nThe ungraceful termination occurred because machinectl doesn't block until the\nleader process has actually terminated. Instead, the 'machinectl kill' command\n(by default) simply sends the SIGTERM signal to the leader process and then\nexits immediately. Systemd would see that the ExecStop command had exited, and\nthat there were still processes inside the container runnng, and kill them\nimmediately in order to fulfill its job.\n\nnspawn-stop gets around this issue by working out what the leader process is,\ncalling 'machinectl kill' itself, then waiting until the leader process has\nactually terminated before exiting itself. By using this as the ExecStop\nprogram for the relevant service unit, it gives the leader process inside the\ncontainer enough time to shut itself down cleanly.\n\nTo use nspawn-stop, run it like so:\n\n nspawn-stop mymachinename\n\nIt is possible to adjust the amount of time that nspawn-stop will wait for the\nleader process to terminate by passing the --timeout flag:\n\n nspawn-stop mymachinename --timeout 10\n\nThe default timeout is 60 seconds. Note that nspawn-stop will not kill\nprocesses inside the container itself. If the timeout expires and there are\nstill processes running inside the container, it is up to the caller to kill\nthem. When used as the ExecStop program for an nspawn machine, the caller is\nsystemd, and it will kill these remaining processes (as described above).", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/djmattyg007/nspawn-tools", "keywords": null, "license": "GPLv3", "maintainer": null, "maintainer_email": null, "name": "nspawn-tools", "package_url": "https://pypi.org/project/nspawn-tools/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/nspawn-tools/", "project_urls": { "Homepage": "https://github.com/djmattyg007/nspawn-tools" }, "release_url": "https://pypi.org/project/nspawn-tools/1.1.2/", "requires_dist": null, "requires_python": null, "summary": "Convenience code for dealing with systemd-nspawn machines", "version": "1.1.2" }, "last_serial": 2650463, "releases": { "1.1.2": [ { "comment_text": "", "digests": { "md5": "87b15657157be873ab4fa32153d779d8", "sha256": "d2299be1fec8f844400b68d71632b731dd15722862de5c290b7e238023c0e643" }, "downloads": -1, "filename": "nspawn_tools-1.1.2.tar.gz", "has_sig": false, "md5_digest": "87b15657157be873ab4fa32153d779d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4574, "upload_time": "2017-02-17T21:36:45", "url": "https://files.pythonhosted.org/packages/2a/e3/ede0c9805f7baa361eb90cda47eda4003255b5183a85c415c997ba5c952b/nspawn_tools-1.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "87b15657157be873ab4fa32153d779d8", "sha256": "d2299be1fec8f844400b68d71632b731dd15722862de5c290b7e238023c0e643" }, "downloads": -1, "filename": "nspawn_tools-1.1.2.tar.gz", "has_sig": false, "md5_digest": "87b15657157be873ab4fa32153d779d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4574, "upload_time": "2017-02-17T21:36:45", "url": "https://files.pythonhosted.org/packages/2a/e3/ede0c9805f7baa361eb90cda47eda4003255b5183a85c415c997ba5c952b/nspawn_tools-1.1.2.tar.gz" } ] }