Rust library to ease the task of creating daemons, I have drawn heavy inspiration from Daemonize by knsd.
I just reached a mature enough point to call this code usable as it is now doing what it should (it still needs better testing however). This being said, I'm electing to release the library in a first version as is and keep improving it.
Example: ```rust extern crate daemonizeme; use daemonizeme::Daemon; use std::fs::File;
fn main() { let stdout = File::create("info.log").unwrap(); let stderr = File::create("err.log").unwrap(); let daemon = Daemon::new() .pidfile("example.pid", Some(false)) .user("daemon") .group("daemon") .umask(0o000) .workdir(".") .stdout(stdout) .stderr(stderr) .start();
match daemon {
Ok(_) => println!("Daemonized with success"),
Err(e) => eprintln!("Error, {}", e),
}
} ```
Licensed under either of
* Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
* BSD 3 Clause License
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.