4 releases

0.2.0 Jan 9, 2024
0.1.2 Nov 7, 2022
0.1.1 Oct 5, 2021
0.1.0 Nov 2, 2020

#336 in Unix APIs

Download history 21/week @ 2024-01-07 3/week @ 2024-02-11 32/week @ 2024-02-18 27/week @ 2024-02-25 1/week @ 2024-03-03 5/week @ 2024-03-10 1/week @ 2024-03-17 56/week @ 2024-03-31

62 downloads per month
Used in inputplug

MIT license

14KB
213 lines

BSD pidfile for Rust

This crate provides a wrapper for a family of pidfile_* functions provided in the BSD systems by libutil, and elsewhere by libbsd.

Known alternatives in pure Rust:

  • pidfile by Carl Lerche, very advanced, but last updated in 2014 and no longer compiles with modern Rust.
  • pidlock by Paul Hummer provides a lock-like API, but doesn’t actually use filesystem locks.
  • qpidfile by Jan Danielsson, well-maintained, but very basic.

The BSD pidfile functions employ very clever locking mechanism, detect concurrently running daemons and allow deferring writes to the PID file, so potential errors can be handled before a fork.

The ultimate goal is to rewrite these functions in Rust, but until a rewrite is done, it’s best to use the BSD functions using the FFI.

License

MIT license, also known as the Expat license.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be licensed as above, without any additional terms or conditions.

Dependencies

~0.4–1MB
~22K SLoC