{"record":{"id":"f8162bdde4a15b35","repo":"zeroclaw-labs/zeroclaw","slug":"service-management-is-supported-on-macos-and-linux","errorCode":null,"errorMessage":"Service management is supported on macOS and Linux only","messagePattern":"Service management is supported on macOS and Linux only","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-runtime/src/service/mod.rs","lineNumber":722,"sourceCode":"        .unwrap_or(false)\n    {\n        return true;\n    }\n    run_capture(Command::new(\"rc-service\").args(linux_openrc_action_args(config, \"status\")))\n        .map(|out| out.contains(\"started\"))\n        .unwrap_or(false)\n}\n\npub fn install(config: &Config, init_system: InitSystem) -> Result<()> {\n    if cfg!(target_os = \"macos\") {\n        install_macos(config)\n    } else if cfg!(target_os = \"linux\") {\n        let resolved = init_system.resolve()?;\n        install_linux(config, resolved)\n    } else if cfg!(target_os = \"windows\") {\n        install_windows(config)\n    } else {\n        anyhow::bail!(\"Service management is supported on macOS and Linux only\");\n    }\n}\n\npub fn start(config: &Config, init_system: InitSystem) -> Result<()> {\n    if cfg!(target_os = \"macos\") {\n        // Ensure the Homebrew var directory exists before launchd tries to use it.\n        // The plist may reference this path for WorkingDirectory and log files.\n        let exe = std::env::current_exe().ok();\n        if let Some(ref exe_path) = exe\n            && let Some(var_dir) = homebrew_var_dir_from_exe(exe_path)\n        {\n            let _ = fs::create_dir_all(&var_dir);\n        }\n        let plist = macos_service_file()?;\n        run_checked(Command::new(\"launchctl\").arg(\"load\").arg(\"-w\").arg(&plist))?;\n        run_checked(Command::new(\"launchctl\").arg(\"start\").arg(SERVICE_LABEL))?;\n        println!(\"✅ Service started\");\n        Ok(())","sourceCodeStart":704,"sourceCodeEnd":740,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-runtime/src/service/mod.rs#L704-L740","documentation":"install() dispatches on the compiled target: macOS (launchd), Linux (init-system aware install_linux), Windows (install_windows via schtasks). Every other platform falls through to this bail. The message text predates Windows support, so in practice it only fires on builds for other Unixes such as FreeBSD, OpenBSD or illumos.","triggerScenarios":"Executing 'zeroclaw service install' on a platform none of the cfg! branches match; the code compiles there but service management is unimplemented.","commonSituations":"Porting the binary to a BSD; running an unofficial community build on a niche Unix; cross-compiling and smoke-testing service commands on a non-supported target.","solutions":["Run zeroclaw as a plain foreground process under your platform's supervisor (rc.d, runit, s6) instead of 'service install'","Wrap 'zeroclaw run' in a platform-native service definition maintained outside the binary","Request or contribute platform support upstream"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"fn service_install_supported() -> bool {\n    cfg!(any(target_os = \"macos\", target_os = \"linux\", target_os = \"windows\"))\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate service commands in wrappers on OS detection before invoking them","Document supported platforms (macOS, Linux, Windows) in install docs","Ship a platform-appropriate service file separately on unsupported OSes"],"tags":["platform-support","bsd","service","install"],"backgroundTag":"unsupported-platform","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}