#kill #process #terminate #timeout #wait

process_control

Ergonomically run processes with limits

26 releases (stable)

4.0.3 Mar 31, 2023
4.0.1 Dec 17, 2022
4.0.0 Sep 11, 2022
3.5.1 Jun 13, 2022
0.7.0 Mar 17, 2020

#101 in Concurrency

Download history 1917/week @ 2023-05-31 2207/week @ 2023-06-07 1917/week @ 2023-06-14 1518/week @ 2023-06-21 1445/week @ 2023-06-28 1521/week @ 2023-07-05 1468/week @ 2023-07-12 1585/week @ 2023-07-19 1753/week @ 2023-07-26 1388/week @ 2023-08-02 1161/week @ 2023-08-09 1427/week @ 2023-08-16 2273/week @ 2023-08-23 1890/week @ 2023-08-30 1663/week @ 2023-09-06 1687/week @ 2023-09-13

7,739 downloads per month
Used in 6 crates

MIT/Apache

51KB
1K SLoC

Process Control

This crate allows running a process with resource limits, such as a running time, and the option to terminate it automatically afterward. The latter is surprisingly difficult to achieve on Unix, since process identifiers can be arbitrarily reassigned when no longer used. Thus, it would be extremely easy to inadvertently terminate an unexpected process. This crate protects against that possibility.

Methods for setting limits are available on ChildExt, which is implemented for Child. They each return a builder of options to configure how the limit should be applied.

Warning: This crate should not be used for security. There are many ways that a process can bypass resource limits. The limits are only intended for simple restriction of harmless processes.

GitHub Build Status

Usage

Add the following lines to your "Cargo.toml" file:

[dependencies]
process_control = "4.0"

See the documentation for available functionality and examples.

Rust version support

The minimum supported Rust toolchain version is currently Rust 1.58.0.

Minor version updates may increase this version requirement. However, the previous two Rust releases will always be supported. If the minimum Rust version must not be increased, use a tilde requirement to prevent updating this crate's minor version:

[dependencies]
process_control = "~4.0"

License

Licensing terms are specified in COPYRIGHT.

Unless you explicitly state otherwise, any contribution submitted for inclusion in this crate, as defined in LICENSE-APACHE, shall be licensed according to COPYRIGHT, without any additional terms or conditions.

Dependencies

~0–10MB
~93K SLoC