Skip to content
forked from knsd/daemonize

Library for writing system daemons

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

mcginty/daemonize

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 https://knsd.github.io/daemonize/.

Usage example:

#[macro_use] extern crate log;
extern crate daemonize;

use daemonize::{Daemonize};

fn main() {
    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.

About

Library for writing system daemons

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%