{ "info": { "author": "Niklas Rosenstein", "author_email": "rosensteinniklas@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "nocrux\n======\n\nNocrux is an easily configurable daemon manager that can be used by any\nuser on the system. It uses double-forks to transfer cleanup\nresponsibility of daemons to the init process.\n\n- `Synopsis <#synopsis>`__\n- `Requirements <#requirements>`__\n- `Installation <#installation>`__\n- `A note about child processes <#a-note-about-child-processes>`__\n- `A note about managing daemons under a different\n user <#a-note-about-managing-daemons-under-a-different-user>`__\n- `Changelog <#changelog>`__\n\nSynopsis\n--------\n\n::\n\n usage: nocrux [-h] [-e] [-l] [-f] [--sudo] [--as AS_] [--stderr] [--version]\n [daemon] [command]\n\n Nocrux is a daemon process manager that is easy to configure and can\n operate on the user- or root-level. The nocrux configuration syntax is\n similar to Nginx. All users configuration file is in ~/.nocrux/conf,\n except for the root user, which is in /etc/nocrux/conf.\n \n This will start your $EDITOR to open the configuration file:\n \n $ nocrux -e\n \n The main namespace has the options and default values below:\n \n root ~/.nocrux/run;\n kill_timeout 10;\n \n You can also include other files like this (relative paths are considered\n relative to the configuration file):\n \n include ~/more-nocrux-config.txt;\n \n To configure a new daemon, you start a `daemon` section, specify the name\n and then the daemon's options in the news scope.\n \n daemon jupyter {\n cwd ~;\n run jupyter notebook;\n }\n \n You can now start the daemon with:\n \n $ nocrux jupyter start\n [nocrux]: (jupyter) starting \"jupyter notebook\"\n [nocrux]: (jupyter) started (pid: 10117)\n \n The following commands are available for all daemons:\n \n - start\n - stop\n - restart\n - status\n - pid\n - cat\n - tail\n \n You can specify additional commands like this:\n \n daemon jupyter {\n cwd ~;\n run jupyter notebook;\n command uptime echo $(($(date +%s) - $(date +%s -r $DAEMON_PIDFILE))) seconds;\n }\n \n Now to run this command:\n \n $ nocrux jupyter uptime;\n 3424 seconds;\n \n Here's a daemon configuration with all available options and the\n respective default or example values:\n \n daemon test {\n # Example values:\n export PATH=/usr/sbin:$PATH;\n export DEBUG=1;\n run ~/Desktop/mytestdaemon.sh arg1 \"arg 2\";\n cwd ~;\n command uptime echo $(($(date +%s) - $(date +%s -r $DAEMON_PIDFILE))) seconds;\n requires daemon1 daemon2;\n \n # Options with their respective defaults:\n user me;\n group me;\n stdin /dev/null;\n stdout $root/$name.out;\n stderr $stdout;\n pidfile $root/$name.pid;\n signal term TERM;\n signal kill KILL;\n }\n\n positional arguments:\n daemon The name of the daemon.\n command A command to execute on the specified daemon.\n\n optional arguments:\n -h, --help show this help message and exit\n -e, --edit Edit the nocrux configuration file.\n -l, --list List up all daemons and their status.\n -f, --follow Pass -f to the tail command.\n --sudo Re-invoke the same command with sudo.\n --as AS_ Run the command as the specified user. Overrides --sudo.\n --stderr Choose stderr instead of stdout for the cat/tail command.\n --version Print the nocrux version and exit.\n\nRequirements\n------------\n\n- Unix-like OS (tested on Ubuntu 15-17, Debian Jessie, macOS Sierra)\n- Python 3.4+\n- `Node.py `__ (optional)\n\nInstallation\n------------\n\n::\n\n $ pip3 install --user nocrux # or\n $ nodepy-pm install git+https://github.com/NiklasRosenstein/nocrux.git@v2.0.3 --global\n\nA note about child processes\n----------------------------\n\nNocrux can only send SIGTERM or SIGKILL to the **main process** that it\noriginally started. If that process spawns any child precesses, it must\ntake care of forwarding the signal! The thread `*Forward SIGTERM to\nchild in Bash* `__\ncontains some information on doing that for Bash scripts. For very\nsimple scripts that just set up an environment, I recommend the ``exec``\napproach as described in the link.\n\nA note about managing daemons under a different user\n----------------------------------------------------\n\nExample:\n\n::\n\n daemon gogs {\n user gogs;\n cwd /home/gogs/gogs;\n run ./gogs web;\n }\n\nIf you're trying to manage a daemon that will be started by nocrux under\na different user, you need the permissions to do so. For example, the\nsuperuser is allowed to do so and using nocrux as root should work\nimmediately.\n\nHowever, if you are not already the root user, nocrux will by default\ntry to re-run itself as the user specified in the daemon, eg. in this\ncase:\n\n::\n\n sudo gogs NOCRUX_CONFIG=/home/niklas/.nocrux/conf /home/niklas/.local/bin/nocrux gogs start\n\nThis will only work if\n\n1. You installed nodepy system-wide, **or** you installed it with\n Node.py and the ``gogs`` user can read the path of the nocrux\n executable and the nocrux package directory\n2. The ``gogs`` user can read your nocrux configuration file\n\nOtherwise, you may be greeted with one of the following error messages:\n\n- sudo: unable to execute /home/niklas/.local/bin/nocrux: Permission\n denied\n- pkg\\_resources.DistributionNotFound: The 'nocrux==2.0.3' distribution\n was not found and is required by the application\n- ModuleNotFoundError: No module named 'nodepy'\n\nChangelog\n---------\n\n**v2.0.3**\n\n- Update for Node.py 2\n- Add ``--sudo`` command-line option\n- Add ``--as `` command-line option\n- Add support for variable substition in the ``daemon { export; }``\n field\n- Add support for custom signals for termination and killing a daemon\n process (see issue #21)\n- Add support for custom daemon subcommands that have access to the\n following environment variables: ``$DAEMON_PID``,\n ``$DAEMON_PIDFILE``, ``$DAEMON_STDOUT``, ``$DAEMON_STDERR`` (see\n issue #22)\n- Add support for ``daemon{ root; }`` field which will change the\n parent directory of the default paths for the PID and standard output\n files\n- Add support for ``#`` comments in the configuration file\n- Change behaviour of ``daemon { user; }`` option, now serves as a\n default value for the ``--as`` option\n- Fix configuration loading (``daemon { run; }`` may now be preceeded\n by any other option)\n- Fix ``-e, --edit`` now opens the editor always for the user's file\n\n**v2.0.2**\n\n- fix ``nocrux version`` command\n- add ``nocrux edit`` command\n- order of daemons when referencing them with ``all`` is now sorted\n alphabetically\n\n**v2.0.1**\n\n- removed ``fn:out``, ``fn:err`` and ``fn:pid`` commands (actually\n already removed in 2.0.0)\n- the default ``root`` config value will now be ``/var/run/nocrux`` if\n the configuration file is loaded from ``/etc/nocrux/conf``\n- more sophisticated config file parsing with ``nr.parse.strex`` module\n- update error message hinting to check output of\n ``nocrux tail`` if daemon could not be started\n\n**v2.0.0**\n\n- cli is now ``nocrux `` (switched)\n- to specify multiple daemons, the ```` argument can be a list\n of comma separated daemon names\n- configuration file is no longer a Python script\n- configuration file must now be located at ``~/.nocrux/conf`` or\n ``/etc/nocrux/conf``\n- nocrux can now be installed via Node.py\n- add support for defining per-process environment variables\n\n**v1.1.3**\n\n- update ``README.md`` (corrected example and command-line interface)\n- remove unusued ``-e, --stderr`` argument\n- fix ``setup.py`` (use ``py_modules`` instead of the invalid\n ``modules`` parameter)\n- enable running ``nocrux.py`` directly without prior installation\n- add ``pid``, ``tail``, ``tail:out`` and ``tail:err`` subcommands\n\n**v1.1.2**\n\n- add ``setup.py`` installation script, remove ``nocrux`` script\n- update ``README.md`` and renamed from ``README.markdown``\n\n**v1.1.1**\n\n- close #18: Automatically expand prog ~ before starting process\n- fix #17: PID file not deleted after daemon stopped\n- close #16: Tail command is counter intuitive\n- update output of command-line program\n- process exit code is now printed to daemon standard error output file\n- fixed stopping multiple daemons when one wasn't running\n- implement #10: daemon dependencies\n\n**v1.1.0**\n\n- Renamed to ``nocrux``\n- Update README and command-line help description\n\n**v1.0.1**\n\n- Add ``krugs tail [-e/-stderr]`` command\n- Add special deaemon name ``all``\n- Fix ``krugs restart`` command", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/NiklasRosenstein/nocrux", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "nocrux", "package_url": "https://pypi.org/project/nocrux/", "platform": "", "project_url": "https://pypi.org/project/nocrux/", "project_urls": { "Homepage": "https://github.com/NiklasRosenstein/nocrux" }, "release_url": "https://pypi.org/project/nocrux/2.0.3/", "requires_dist": null, "requires_python": "", "summary": "a painless per-user daemon manager", "version": "2.0.3" }, "last_serial": 3359874, "releases": { "1.1.2": [ { "comment_text": "", "digests": { "md5": "dc69c9377794bb632f637d32a7235372", "sha256": "180fc7aab8fad86f650e37c5c627fd68aed63e315224f667581fe70293ffbfc3" }, "downloads": -1, "filename": "nocrux-1.1.2.zip", "has_sig": false, "md5_digest": "dc69c9377794bb632f637d32a7235372", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7341, "upload_time": "2016-05-11T00:31:08", "url": "https://files.pythonhosted.org/packages/4a/1a/676ef1d164b185213c195d8e3d04376606bf3e1da0559ea9d6521f70da89/nocrux-1.1.2.zip" } ], "1.1.3": [ { "comment_text": "", "digests": { "md5": "9d9080b9174da81a452f075376b4781b", "sha256": "32c516cd8b899716aab17027e86bf68b3763b8f62d05f4afe0c68453afa5a421" }, "downloads": -1, "filename": "nocrux-1.1.3.zip", "has_sig": false, "md5_digest": "9d9080b9174da81a452f075376b4781b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12047, "upload_time": "2016-05-11T10:32:25", "url": "https://files.pythonhosted.org/packages/b1/eb/6658e1e3a9188eeecfa6e482523943b40f530937ebe2b6ec7e15e0903e31/nocrux-1.1.3.zip" } ], "1.1.4": [ { "comment_text": "", "digests": { "md5": "bbfc2cc63927cd620832a835e5d04a65", "sha256": "6cbfbcc481734055b6bf28b9cfb11520000c22ad2c9620aa5c642f3ec2e86bd7" }, "downloads": -1, "filename": "nocrux-1.1.4.tar.gz", "has_sig": false, "md5_digest": "bbfc2cc63927cd620832a835e5d04a65", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5429, "upload_time": "2017-03-01T23:55:57", "url": "https://files.pythonhosted.org/packages/38/ee/0a2220cdb72c05c2ba78a25780aac5449bf8ed9e7eb9b784c5d282e39683/nocrux-1.1.4.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "5fe9042fbdf80019d640a9b80d6d69b6", "sha256": "2376bc4a7d2572d0575f7997a65a371acb3d7992185252c29c77037e870b3799" }, "downloads": -1, "filename": "nocrux-2.0.0.tar.gz", "has_sig": false, "md5_digest": "5fe9042fbdf80019d640a9b80d6d69b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9060, "upload_time": "2017-05-05T22:16:14", "url": "https://files.pythonhosted.org/packages/7b/9f/cdc4e572fd44f04ff2e1b13f3f896fa66813316944266149fa06606d11d9/nocrux-2.0.0.tar.gz" } ], "2.0.1": [ { "comment_text": "", "digests": { "md5": "8f4efa93dfe011a3f17e17815e4d0d36", "sha256": "4f0c1a3d5a9f5b1549492c9c5773934903bc76f73fe509d93aa7f908d8ab229a" }, "downloads": -1, "filename": "nocrux-2.0.1.tar.gz", "has_sig": false, "md5_digest": "8f4efa93dfe011a3f17e17815e4d0d36", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9263, "upload_time": "2017-05-14T01:31:48", "url": "https://files.pythonhosted.org/packages/66/f9/366577db6c407021e81d4623ef4a433af71876f65a34d472287916447a14/nocrux-2.0.1.tar.gz" } ], "2.0.2": [ { "comment_text": "", "digests": { "md5": "e7fd9da671f282f0f3db93e2752d4eb0", "sha256": "76277071897a7c5860007ee5b6bd6dc8633e547404c9277e487c52614f9963f6" }, "downloads": -1, "filename": "nocrux-2.0.2.tar.gz", "has_sig": false, "md5_digest": "e7fd9da671f282f0f3db93e2752d4eb0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10190, "upload_time": "2017-05-14T01:46:02", "url": "https://files.pythonhosted.org/packages/2c/f7/c1ac7e133d18512e0f03d4b9d5d1be343dcbcc7845ff74308cc14982e3d2/nocrux-2.0.2.tar.gz" } ], "2.0.3": [ { "comment_text": "", "digests": { "md5": "df0e4606e91fea507037eb79df5e5fbd", "sha256": "2460f336a6413c15eb80fbf0f6eb720191d0b7f1f672e2e49bdcdc88faf0d0b4" }, "downloads": -1, "filename": "nocrux-2.0.3.tar.gz", "has_sig": false, "md5_digest": "df0e4606e91fea507037eb79df5e5fbd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14359, "upload_time": "2017-11-24T03:19:56", "url": "https://files.pythonhosted.org/packages/db/5f/1b863d80a97ed3778e21c216b3db9c99e7a0f85e5e7812ee3c29917976b3/nocrux-2.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "df0e4606e91fea507037eb79df5e5fbd", "sha256": "2460f336a6413c15eb80fbf0f6eb720191d0b7f1f672e2e49bdcdc88faf0d0b4" }, "downloads": -1, "filename": "nocrux-2.0.3.tar.gz", "has_sig": false, "md5_digest": "df0e4606e91fea507037eb79df5e5fbd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14359, "upload_time": "2017-11-24T03:19:56", "url": "https://files.pythonhosted.org/packages/db/5f/1b863d80a97ed3778e21c216b3db9c99e7a0f85e5e7812ee3c29917976b3/nocrux-2.0.3.tar.gz" } ] }