#process #terminate #timeout #wait #kill

process_control

Ergonomically run processes with limits

27 releases (stable)

4.1.0 Feb 17, 2024
4.0.3 Mar 31, 2023
4.0.2 Jan 29, 2023
4.0.1 Dec 17, 2022
0.7.0 Mar 17, 2020

#85 in Operating systems

Download history 1190/week @ 2023-12-23 1531/week @ 2023-12-30 1103/week @ 2024-01-06 1195/week @ 2024-01-13 1567/week @ 2024-01-20 1898/week @ 2024-01-27 2621/week @ 2024-02-03 1820/week @ 2024-02-10 2455/week @ 2024-02-17 2292/week @ 2024-02-24 1762/week @ 2024-03-02 1983/week @ 2024-03-09 2348/week @ 2024-03-16 2156/week @ 2024-03-23 1888/week @ 2024-03-30 1104/week @ 2024-04-06

7,806 downloads per month
Used in 10 crates (7 directly)

MIT/Apache

49KB
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.1"

See the documentation for available functionality and examples.

Rust version support

The minimum supported Rust toolchain version is currently Rust 1.74.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.1"

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–11MB
~82K SLoC