yad

Crates.ioyad
lib.rsyad
version0.2.0
sourcesrc
created_at2021-02-15 14:35:20.655917
updated_at2022-11-15 19:51:07.715859
descriptionYet Another Daemonizer is a daemonizing crate to easily, simply, and correctly create legacy daemons
homepage
repositoryhttps://github.com/m-lima/yad
max_upload_size
id355538
size41,200
(m-lima)

documentation

README

Yet Another Daemonizer

Github MIT licensed Cargo Documentation

Yet Another Daemonizer is a daemonizing crate to easily, simply, and correctly create legacy daemons.

This crate focuses on manually creating a background process which is not managed by a supervisor such as systemd or launchd. It strives to follow all the best practices to correctly daemonize a process.

Example

use yad::Stdio;

match yad::with_options()
    .stdin(Stdio::Null)
    .stderr(Stdio::Null)
    .stdout(Stdio::output("/var/log/daemon.log"))
    .daemonize()
{
    Ok(_) => println!("I'm a daemon"),
    Err(err) => eprintln!("Failed to launch daemon: {}", err),
}

References

Commit count: 27

cargo fmt