Debian Codegraph @

/

debian rust-daemonix 0.1.0-2debian librust-daemonix-dev debian librust-daemonix+default-dev debian librust-daemonix-0-dev debian librust-daemonix-0+default-dev debian librust-daemonix-0.1-dev debian librust-daemonix-0.1+default-dev debian librust-daemonix-0.1.0-dev debian librust-daemonix-0.1.0+default-dev cargo daemonix 0.1.0 debianjsonmakefilemarkdownrustrust-c-abishelltoml 17 files · 316 symbols
View dependency graph

Depends on

  • dh-cargo (dh-sequence-cargo)
  • rust-libc (librust-libc-0.2+default-dev)
  • cargo, debhelper-compat, libstd-rust-dev, rustc
README (full)

dameonix

This is a maintained fork of the daemonize crate, which in turn was inspired by the thesharp/daemonize Python library.

dameonix v0.1.0 is identical with daemonize v0.5.0 but with a fix for the reported UB issue applied. Future major versions will likely change or remove APIs to reduce the amount of unsafe code that needs to be audited and documented.

Usage example:

use std::fs::File;

use daemonix::Daemonize;

fn main() {
    let stdout = File::create("/tmp/daemon.out").unwrap();
    let stderr = File::create("/tmp/daemon.err").unwrap();

    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.
        .stdout(stdout)  // Redirect stdout to `/tmp/daemon.out`.
        .stderr(stderr)  // Redirect stderr to `/tmp/daemon.err`.
        .privileged_action(|| "Executed before drop privileges");

    match daemonize.start() {
        Ok(_) => println!("Success, daemonized"),
        Err(e) => eprintln!("Error, {}", e),
    }
}

License

Licensed under either of

at your option.

Contribution

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

dir debian/
dir examples/
dir src/
file .cargo_vcs_info.json
file Cargo.lock
file Cargo.toml
file Cargo.toml.orig
file LICENSE-APACHE
file LICENSE-MIT
file README.md