paritytech/daemonize

Name: daemonize

Owner: Parity Technologies

Description: Library for writing system daemons

Created: 2018-02-28 14:28:11.0

Updated: 2018-02-28 14:28:13.0

Pushed: 2018-02-28 17:07:28.0

Homepage: http://knsd.github.io/daemonize/

Size: 3388

Language: Rust

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

daemonize Build Status Latest Version

daemonize is a library for writing system daemons. Inspired by the Python library thesharp/daemonize.

The documentation is located at http://knsd.github.io/daemonize/.

Usage example:

cro_use] extern crate log;
rn crate daemonize;

daemonize::{Daemonize};

ain() {
let daemonize = Daemonize::new()
    .pid_file("/tmp/test.pid") // Every method except `new` and `start`
    .chown_pid_file(true)      // is optional, see `Daemonize` documentation
    .working_directory("/tmp") // for default behaviour.
    .user("nobody")
    .group("daemon") // Group name
    .group(2)        // or group id.
    .umask(0o777)    // Set umask, `0o027` by default.
    .privileged_action(|| "Executed before drop privileges");

 match daemonize.start() {
     Ok(_) => info!("Success, daemonized"),
     Err(e) => error!("{}", e),
 }

License

Licensed under either of

Contribution

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


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.