extern crate daemonize; use daemonize::Daemonize; fn main() { let args = std::env::args().collect::>(); let ref pid = args[1]; Daemonize::new().pid_file(pid).start().unwrap(); }