diff --git a/docs/_docs/user-guide/imix.md b/docs/_docs/user-guide/imix.md index c1a8c30d..1bab59e6 100644 --- a/docs/_docs/user-guide/imix.md +++ b/docs/_docs/user-guide/imix.md @@ -82,7 +82,7 @@ rustup target add x86_64-unknown-linux-musl sudo apt update sudo apt install musl-tools cd realm/implants/imix/ -RUSTFLAGS="-C target-feature=+crt-static" cargo build --release --target=x86_64-unknown-linux-musl +RUSTFLAGS="-C target-feature=+crt-static" cargo build --release --bin imix --target=x86_64-unknown-linux-musl ``` ### MacOS diff --git a/implants/imix/src/lib.rs b/implants/imix/src/lib.rs index 9de3c4e1..26afb9aa 100644 --- a/implants/imix/src/lib.rs +++ b/implants/imix/src/lib.rs @@ -6,22 +6,11 @@ mod install; mod run; mod task; mod version; -#[cfg(feature = "win_service")] -pub mod win_service; #[tokio::main(flavor = "multi_thread", worker_threads = 128)] pub async fn lib_entry() { #[cfg(debug_assertions)] run::init_logging(); - #[cfg(feature = "win_service")] - match windows_service::service_dispatcher::start("imix", ffi_service_main) { - Ok(_) => {} - Err(_err) => { - #[cfg(debug_assertions)] - log::error!("Failed to start service (running as exe?): {_err}"); - } - } - run::handle_main().await } diff --git a/implants/imix/src/main.rs b/implants/imix/src/main.rs index 501e3c2a..c964842d 100644 --- a/implants/imix/src/main.rs +++ b/implants/imix/src/main.rs @@ -4,6 +4,8 @@ #[cfg(all(feature = "win_service", windows))] #[macro_use] extern crate windows_service; +#[cfg(all(feature = "win_service", windows))] +mod win_service; mod agent; mod config; @@ -43,6 +45,6 @@ define_windows_service!(ffi_service_main, service_main); #[cfg(feature = "win_service")] #[tokio::main(flavor = "multi_thread", worker_threads = 128)] async fn service_main(arguments: Vec) { - imix::win_service::handle_service_main(arguments); + crate::win_service::handle_service_main(arguments); handle_main().await; }