ptimeout


Nameptimeout JSON
Version 1.4.0 PyPI version JSON
download
home_pagehttps://github.com/guillon/ptimeout
SummarySimple and interruptible timeout tool
upload_time2022-11-30 15:15:45
maintainer
docs_urlNone
authorChristophe Guillon
requires_python
licenseGPLv2
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            
[![Build Status](https://api.travis-ci.org/guillon/ptimeout.png?branch=master)](https://travis-ci.org/guillon/ptimeout/branches)

# Synopsys

The ptimeout utility is a python script implementing an interface similar to
GNU timeout with the additional ability to terminate all processes launched
from the timeout session.

In order to terminate all processes launched as part of the timeout
session, an environment variable is propagated along with processes creation.

This heuristic enables terminations of detached processes even when
they are not anymore in the process parent-child tree.

This also avoids the usage of process groups or process session leadership
which have some undesirable effect observed with timeout tools provided
with standard distributions. This approach is thus more transparent w.r.t.
to overall process management.

The limitation to this approach is when some process reset its environment,
in which case it will not be tracked anymore (nor any of its child) by
the termination heuristic. In this case the sub-process tree may not
terminate as part of the timeout session.

# Download

Download the last stable version of the script from there:
https://raw.githubusercontent.com/guillon/ptimeout/master/ptimeout

# Examples

A typical usage of such a tool if for limiting the time of a batch job
which may fall into non terminating condition such as in validation
scripts or test processes.

Also one generally expect the whole set of executed processes as part of
the job lifetime to be teminated when the job terminates, hence the
termination heuristic.

Example of usage for limiting a batch script to 1 hour duration:

    $ ptimeout 3600 script.sh

By default script.sh and all process executed from its process tree will
be terminated with SIGTERM after 3600 seconds, or killed by SIGKILL 10
seconds after if still persistent.

If one wants only process garbage collection, use a timeout of 0 as in:

    $ ptimeout 0 script.sh

In this case, the tool will not bound the execution time, but will still
garbage collect all processes when receiving an interrupting signal.

The usage of ptimeout can be recursive and there is not side effect with
respect to interactive/sessions/tty modes.

Get the command line help with:

    $ ptimeout --help
    usage: ptimeout [-h] [-v] [-d] [-s SIGNAL] [-k KILL_AFTER] [-c CATCH_SIGNALS]
                [-l LIST] [-f FORMAT]
                [duration] [command] ...
    ....


# Build and Install

This script requires python 2.6, 2.7 or 3.3+.

The script can be used directly without installation.

A makefile is provided anyway for completion and testing purpose.

Build with:

    $ make all # a no-op actually

Run unittests with:

    $ make check

Install with, for instance:

    $ make install PREFIX=$HOME/local  # Default is PREFIX=/usr/local


# References

Refer to the project home page at:
http://guillon.github.com/ptimeout

Refer to the current build and validation status at:
https://travis-ci.org/guillon/ptimeout?branches

Fill issues and enhancement request at:
https://github.com/guillon/ptimeout/issues


# License

The tool is distributed under the GPLv2 license.

Refer to the COPYING file: https://github.com/guillon/ptimeout/blob/master/COPYING
Refer to the COPYRIGHT file: https://github.com/guillon/ptimeout/blob/master/COPYRIGHT

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/guillon/ptimeout",
    "name": "ptimeout",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Christophe Guillon",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/ac/5d/69dd81836cd98b3fd2e769fdbe605398dac15de305fc93d8ed8b14dc1065/ptimeout-1.4.0.tar.gz",
    "platform": null,
    "description": "\n[![Build Status](https://api.travis-ci.org/guillon/ptimeout.png?branch=master)](https://travis-ci.org/guillon/ptimeout/branches)\n\n# Synopsys\n\nThe ptimeout utility is a python script implementing an interface similar to\nGNU timeout with the additional ability to terminate all processes launched\nfrom the timeout session.\n\nIn order to terminate all processes launched as part of the timeout\nsession, an environment variable is propagated along with processes creation.\n\nThis heuristic enables terminations of detached processes even when\nthey are not anymore in the process parent-child tree.\n\nThis also avoids the usage of process groups or process session leadership\nwhich have some undesirable effect observed with timeout tools provided\nwith standard distributions. This approach is thus more transparent w.r.t.\nto overall process management.\n\nThe limitation to this approach is when some process reset its environment,\nin which case it will not be tracked anymore (nor any of its child) by\nthe termination heuristic. In this case the sub-process tree may not\nterminate as part of the timeout session.\n\n# Download\n\nDownload the last stable version of the script from there:\nhttps://raw.githubusercontent.com/guillon/ptimeout/master/ptimeout\n\n# Examples\n\nA typical usage of such a tool if for limiting the time of a batch job\nwhich may fall into non terminating condition such as in validation\nscripts or test processes.\n\nAlso one generally expect the whole set of executed processes as part of\nthe job lifetime to be teminated when the job terminates, hence the\ntermination heuristic.\n\nExample of usage for limiting a batch script to 1 hour duration:\n\n    $ ptimeout 3600 script.sh\n\nBy default script.sh and all process executed from its process tree will\nbe terminated with SIGTERM after 3600 seconds, or killed by SIGKILL 10\nseconds after if still persistent.\n\nIf one wants only process garbage collection, use a timeout of 0 as in:\n\n    $ ptimeout 0 script.sh\n\nIn this case, the tool will not bound the execution time, but will still\ngarbage collect all processes when receiving an interrupting signal.\n\nThe usage of ptimeout can be recursive and there is not side effect with\nrespect to interactive/sessions/tty modes.\n\nGet the command line help with:\n\n    $ ptimeout --help\n    usage: ptimeout [-h] [-v] [-d] [-s SIGNAL] [-k KILL_AFTER] [-c CATCH_SIGNALS]\n                [-l LIST] [-f FORMAT]\n                [duration] [command] ...\n    ....\n\n\n# Build and Install\n\nThis script requires python 2.6, 2.7 or 3.3+.\n\nThe script can be used directly without installation.\n\nA makefile is provided anyway for completion and testing purpose.\n\nBuild with:\n\n    $ make all # a no-op actually\n\nRun unittests with:\n\n    $ make check\n\nInstall with, for instance:\n\n    $ make install PREFIX=$HOME/local  # Default is PREFIX=/usr/local\n\n\n# References\n\nRefer to the project home page at:\nhttp://guillon.github.com/ptimeout\n\nRefer to the current build and validation status at:\nhttps://travis-ci.org/guillon/ptimeout?branches\n\nFill issues and enhancement request at:\nhttps://github.com/guillon/ptimeout/issues\n\n\n# License\n\nThe tool is distributed under the GPLv2 license.\n\nRefer to the COPYING file: https://github.com/guillon/ptimeout/blob/master/COPYING\nRefer to the COPYRIGHT file: https://github.com/guillon/ptimeout/blob/master/COPYRIGHT\n",
    "bugtrack_url": null,
    "license": "GPLv2",
    "summary": "Simple and interruptible timeout tool",
    "version": "1.4.0",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "8768aeccaa6d64ae93adababf055dbb1",
                "sha256": "70e442523517039ab2f06809d66615e21b0cb2bddb28a7eb81425f67ca5e72c4"
            },
            "downloads": -1,
            "filename": "ptimeout-1.4.0-py2-none-any.whl",
            "has_sig": false,
            "md5_digest": "8768aeccaa6d64ae93adababf055dbb1",
            "packagetype": "bdist_wheel",
            "python_version": "py2",
            "requires_python": null,
            "size": 15846,
            "upload_time": "2022-11-30T15:41:58",
            "upload_time_iso_8601": "2022-11-30T15:41:58.489763Z",
            "url": "https://files.pythonhosted.org/packages/d3/19/bb997673a2eecbd56904ffb97da51a8e41d68428d7f4e49ba3dda9bc6071/ptimeout-1.4.0-py2-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "3bcf769c19927c4681325ecaf86bf1af",
                "sha256": "334b8aca1a667719584fb07787c242c3b64a4deda6e23bec52dd8c2a2ce0f9e1"
            },
            "downloads": -1,
            "filename": "ptimeout-1.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3bcf769c19927c4681325ecaf86bf1af",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 15856,
            "upload_time": "2022-11-30T15:15:43",
            "upload_time_iso_8601": "2022-11-30T15:15:43.390636Z",
            "url": "https://files.pythonhosted.org/packages/2b/d6/adcc08e1861544ba77313fbec33d2dc6d94b6078c5774382bdad943eac5a/ptimeout-1.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "e7c4a3874320d34d0882e50f7d4c4ce0",
                "sha256": "9a81d402e826ddcae758e79165ad6e7b568318c3052969f9b030d1375b137016"
            },
            "downloads": -1,
            "filename": "ptimeout-1.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e7c4a3874320d34d0882e50f7d4c4ce0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 18879,
            "upload_time": "2022-11-30T15:15:45",
            "upload_time_iso_8601": "2022-11-30T15:15:45.823823Z",
            "url": "https://files.pythonhosted.org/packages/ac/5d/69dd81836cd98b3fd2e769fdbe605398dac15de305fc93d8ed8b14dc1065/ptimeout-1.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-11-30 15:15:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "guillon",
    "github_project": "ptimeout",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "lcname": "ptimeout"
}
        
Elapsed time: 0.01221s