{"id":13838417,"url":"https://github.com/knsd/daemonize","last_synced_at":"2025-05-15T00:08:48.637Z","repository":{"id":33409032,"uuid":"37054244","full_name":"knsd/daemonize","owner":"knsd","description":"Library for writing system daemons","archived":false,"fork":false,"pushed_at":"2024-02-14T20:32:02.000Z","size":2526,"stargazers_count":542,"open_issues_count":10,"forks_count":64,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-13T21:33:59.384Z","etag":null,"topics":["daemon","daemonize","linux","osx","rust","system"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/knsd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2015-06-08T08:14:08.000Z","updated_at":"2025-04-02T06:19:26.000Z","dependencies_parsed_at":"2024-01-15T19:43:13.792Z","dependency_job_id":"88d3db43-c342-4757-8ffb-9573b8eb7724","html_url":"https://github.com/knsd/daemonize","commit_stats":{"total_commits":153,"total_committers":14,"mean_commits":"10.928571428571429","dds":"0.36601307189542487","last_synced_commit":"8a87c0b9e5568d2d57284d68e18ea5f24dcad5fb"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knsd%2Fdaemonize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knsd%2Fdaemonize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knsd%2Fdaemonize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knsd%2Fdaemonize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knsd","download_url":"https://codeload.github.com/knsd/daemonize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254249203,"owners_count":22039029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["daemon","daemonize","linux","osx","rust","system"],"created_at":"2024-08-04T15:01:56.218Z","updated_at":"2025-05-15T00:08:43.628Z","avatar_url":"https://github.com/knsd.png","language":"Rust","readme":"daemonize [![Build Status](https://github.com/knsd/daemonize/actions/workflows/rust.yml/badge.svg)](https://github.com/knsd/daemonize/actions/workflows/rust.yml/) [![Latest Version](https://img.shields.io/crates/v/daemonize.svg)](https://crates.io/crates/daemonize/) [![docs](https://docs.rs/daemonize/badge.svg)](https://docs.rs/daemonize)\n=========\n\n\ndaemonize is a library for writing system daemons. Inspired by the Python library [thesharp/daemonize](https://github.com/thesharp/daemonize).\n\nUsage example:\n\n```rust\nextern crate daemonize;\n\nuse std::fs::File;\n\nuse daemonize::Daemonize;\n\nfn main() {\n    let stdout = File::create(\"/tmp/daemon.out\").unwrap();\n    let stderr = File::create(\"/tmp/daemon.err\").unwrap();\n\n    let daemonize = Daemonize::new()\n        .pid_file(\"/tmp/test.pid\") // Every method except `new` and `start`\n        .chown_pid_file(true)      // is optional, see `Daemonize` documentation\n        .working_directory(\"/tmp\") // for default behaviour.\n        .user(\"nobody\")\n        .group(\"daemon\") // Group name\n        .group(2)        // or group id.\n        .umask(0o777)    // Set umask, `0o027` by default.\n        .stdout(stdout)  // Redirect stdout to `/tmp/daemon.out`.\n        .stderr(stderr)  // Redirect stderr to `/tmp/daemon.err`.\n        .privileged_action(|| \"Executed before drop privileges\");\n\n    match daemonize.start() {\n        Ok(_) =\u003e println!(\"Success, daemonized\"),\n        Err(e) =\u003e eprintln!(\"Error, {}\", e),\n    }\n}\n```\n\n### License\n\nLicensed under either of\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you shall be dual licensed as above, without any\nadditional terms or conditions.\n","funding_links":[],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknsd%2Fdaemonize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknsd%2Fdaemonize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknsd%2Fdaemonize/lists"}