Skip to main content

A CLI tool to exit any process with arbitrary exit code

Project description

pexit

This is a CLI tool to exit any process with arbitrary exit code.

Instead of killing a process, do you ever want to "exit" it? pexit comes to the rescue!

With some prerequisites (see below), you can force any process to exit, even with your specified exit code!

Why would you want to use pexit?

  • For fun.
  • In the case of running a pipelined job foo && bar, simply killing foo will cause it to exit with error and bar is not executed. Using pexit, however, can make foo exit with success so that bar continues to be executed.

Install

pip install pexit

Usage

pexit <pid> [<exit_code>]
# The default value for <exit_code> is 0 (meaning success)

Limitations

  • pexit relies on the system call ptrace, which does not exit in some systems (like Windows).
  • To be able to ptrace any process, you may need root privilege (sudo pexit ...) or allow this in system setting (sudo sysctl kernel.yama.ptrace_scope=0).

Acknowledgements

This project refers to the following sources:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pexit-0.1.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pexit-0.1.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file pexit-0.1.0.tar.gz.

File metadata

  • Download URL: pexit-0.1.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.7

File hashes

Hashes for pexit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 94b16c184d437f06db1ee6d5c4356e2f7b57b516f78c05e52dad636ea0ea2197
MD5 c58331d4ab88b0c592753765bc749376
BLAKE2b-256 7e0ac9c6c29880604518fa05583906ad83f95c3126415d13fb0bbaca3ba85200

See more details on using hashes here.

File details

Details for the file pexit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pexit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.7

File hashes

Hashes for pexit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 245a69fe3a0b8b62aef44d3fb4e8e75a48151ae2eeb44861bc4f8fe8453c6c00
MD5 7e7c76fa789b1f27241d617dab1b2f5a
BLAKE2b-256 61f563057e371869ff0f70a6d0a10c82ef75578633d74654cc8a35db694310b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page