diff options
author | HimbeerserverDE <himbeerserverde@gmail.com> | 2024-02-14 16:21:04 +0100 |
---|---|---|
committer | HimbeerserverDE <himbeerserverde@gmail.com> | 2024-02-14 16:21:04 +0100 |
commit | d301670b3e3843b4a878738f0f81c13f63028e2a (patch) | |
tree | c5fbe2a7f5dc17c2a234804f4d199e57f65d1c9f | |
parent | f17d2c04bd0e6a9f39e021093f2e6073ea013d79 (diff) |
remove broken daemonization
-rw-r--r-- | Cargo.lock | 11 | ||||
-rw-r--r-- | hbakd/Cargo.toml | 2 | ||||
-rw-r--r-- | hbakd/src/main.rs | 31 |
3 files changed, 3 insertions, 41 deletions
@@ -309,15 +309,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] -name = "fork" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf2ca97a59201425e7ee4d197c9c4fea282fe87a97d666a580bda889b95b8e88" -dependencies = [ - "libc", -] - -[[package]] name = "generic-array" version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -378,9 +369,7 @@ dependencies = [ name = "hbakd" version = "0.1.0-dev" dependencies = [ - "clap", "ctrlc", - "fork", "hbak_common", "thiserror", ] diff --git a/hbakd/Cargo.toml b/hbakd/Cargo.toml index 0e360e7..2eabd94 100644 --- a/hbakd/Cargo.toml +++ b/hbakd/Cargo.toml @@ -6,8 +6,6 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -clap = { version = "4.4.18", features = ["derive"] } ctrlc = { version = "3.4.2", features = ["termination"] } -fork = "0.1.22" hbak_common = { version = "0.1.0-dev", path = "../hbak_common" } thiserror = "1.0" diff --git a/hbakd/src/main.rs b/hbakd/src/main.rs index cc9ce3f..3572199 100644 --- a/hbakd/src/main.rs +++ b/hbakd/src/main.rs @@ -14,35 +14,10 @@ use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; use std::thread; -use clap::Parser; -use fork::{daemon, Fork}; - -#[derive(Debug, Parser)] -#[command(author, version, about, long_about = None)] -/// Background process to serve push and pull requests. -struct Args { - /// Stay attached to the terminal instead of daemonizing. - #[arg(short, long)] - debug: bool, -} - fn main() { - let args = Args::parse(); - - if args.debug { - match serve() { - Ok(_) => {} - Err(e) => eprintln!("Error: {}", e), - } - } else { - match daemon(false, false) { - Ok(Fork::Parent(_)) => {} - Ok(Fork::Child) => match serve() { - Ok(_) => {} - Err(e) => eprintln!("Error: {}", e), - }, - Err(e) => eprintln!("Error: {}", io::Error::from_raw_os_error(e)), - } + match serve() { + Ok(_) => {} + Err(e) => eprintln!("Error: {}", e), } } |