Skip to main content

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:

Metadata

Release files for pexit 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pexit 0.1.0
File Size Uploaded Provenance
pexit-0.1.0.tar.gz 4.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pexit 0.1.0
File Interpreter ABI Platform
pexit-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.8 kB

Release files / pexit-0.1.0.tar.gz

Download URL pexit-0.1.0.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
94b16c184d437f06db1ee6d5c4356e2f7b57b516f78c05e52dad636ea0ea2197
BLAKE2b-256 checksum
How to use checksums
7e0ac9c6c29880604518fa05583906ad83f95c3126415d13fb0bbaca3ba85200
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.7

Release files / pexit-0.1.0-py3-none-any.whl

Download URL pexit-0.1.0-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
245a69fe3a0b8b62aef44d3fb4e8e75a48151ae2eeb44861bc4f8fe8453c6c00
BLAKE2b-256 checksum
How to use checksums
61f563057e371869ff0f70a6d0a10c82ef75578633d74654cc8a35db694310b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.7

Security for pexit 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page