#pidfile #automatic #process #create #termination #representation #remove

qpidfile

A minimal library for managing a process' pidfile

1 unstable release

0.9.2 Jun 6, 2020

#9 in #termination

40 downloads per month

0BSD license

3KB

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