#[cfg(target_os = "linux")]
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
use std::sync::Arc;
use aa_ebpf::control::server::{bind_hardened, resolve_socket_path, serve, ProbeManager};
use tokio::sync::Mutex;
tracing_subscriber::fmt()
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.init();
let socket_path = resolve_socket_path();
let listener = bind_hardened(&socket_path)?;
tracing::info!(socket = %socket_path.display(), "aa-ebpf-loaderd listening (privileged, owner-only 0600)");
let manager = Arc::new(Mutex::new(ProbeManager::new()));
serve(listener, manager).await?;
Ok(())
}
#[cfg(not(target_os = "linux"))]
fn main() {
eprintln!(
"aa-ebpf-loaderd is Linux-only: eBPF program loading requires the Linux kernel BPF subsystem. \
This binary is a no-op on the current platform."
);
std::process::exit(1);
}