A minimal library for managing a process' pidfile

1 unstable release

0.9.2 Jun 6, 2020

0BSD license



A simple representation of a "pidfile".

Creates a pidfile on creation and automatically remove it on termination.

fn main() {
  let pidfile = Pidfile::new("myserver.pid");
  // .. run server ..

  // On termination the Pidfile will automatically be removed.

Be mindful of the Drop trait caveats; for instance calling std::process::exit() will cause Drop traits not to run.

No runtime deps