Skip to content

Commit

Permalink
Nop out daemonization on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
twizmwazin committed Dec 8, 2023
1 parent 3d149ce commit 2879360
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- x86_64-unknown-linux-musl

# Windows targets
- aarch64-pc-windows-gnu
- i686-pc-windows-gnu
- x86_64-pc-windows-gnu
steps:
Expand Down
2 changes: 2 additions & 0 deletions crates/bh_agent_server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ log = "0.4.20"
env_logger = { version = "0.10.0", default-features = false, features = ["auto-color", "humantime"] }
bimap = "0.6.3"
clap = { version = "4.4.11", features = ["derive"] }

[target.'cfg(not(target_os = "windows"))'.dependencies]
daemonize = "0.5.0"
2 changes: 2 additions & 0 deletions crates/bh_agent_server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ struct Args {
address: IpAddr,
/// The port to listen on
port: u16,
#[cfg(not(target_os = "windows"))]
#[arg(short, long, default_value = "false", help = "Daemonize the process")]
daemonize: bool,
}
Expand All @@ -39,6 +40,7 @@ fn main() -> anyhow::Result<()> {
listener.config_mut().max_frame_length(usize::MAX);

// Daemonize
#[cfg(not(target_os = "windows"))]
if args.daemonize {
daemonize::Daemonize::new()
.pid_file("/tmp/bh_agent_server.pid")
Expand Down

0 comments on commit 2879360

Please sign in to comment.