spacedriveapp/spacedrive · warning · anyhow::Error
Daemon auto-start is currently only supported on macOS and L
Error message
Daemon auto-start is currently only supported on macOS and Linux.
What it means
The `daemon install` subcommand is only implemented for macOS (launchd) and Linux (systemd). On any other compile target, including Windows, the stub `install_launchd_service` immediately returns this error without touching the system. It is a deliberate capability gap, not a runtime malfunction: nothing was installed and no state changed.
Source
Thrown at apps/cli/src/domains/daemon/mod.rs:464
"active" => println!("Service status: ● Active (running)"),
"inactive" => println!("Service status: ○ Inactive (stopped)"),
"failed" => println!("Service status: Failed"),
_ => println!("Service status: {}", status),
}
println!();
println!("Useful commands:");
println!(" systemctl --user status {}", service_name);
println!(" systemctl --user start {}", service_name);
println!(" systemctl --user stop {}", service_name);
println!(" journalctl --user -u {} -f", service_name);
Ok(())
}
#[cfg(not(any(target_os = "macos", target_os = "linux")))]
async fn install_launchd_service(_data_dir: PathBuf, _instance: Option<String>) -> Result<()> {
Err(anyhow::anyhow!(
"Daemon auto-start is currently only supported on macOS and Linux."
))
}
#[cfg(not(any(target_os = "macos", target_os = "linux")))]
async fn uninstall_launchd_service(_instance: Option<String>) -> Result<()> {
Err(anyhow::anyhow!(
"Daemon auto-start is currently only supported on macOS and Linux."
))
}
#[cfg(not(any(target_os = "macos", target_os = "linux")))]
async fn check_launchd_status(_instance: Option<String>) -> Result<()> {
Err(anyhow::anyhow!(
"Daemon auto-start is currently only supported on macOS and Linux."
))
}
View on GitHub (pinned to 6dfeccf211)
Solutions
- On Windows, run the daemon manually: `sd-daemon --data-dir <dir>`.
- For auto-start on Windows, register a logon task yourself: `schtasks /create /tn SpacedriveDaemon /tr 'C:\path\sd-daemon.exe --data-dir C:\path\data' /sc onlogon`.
- Gate the command out of cross-platform scripts: only call `daemon install` when `cfg!(any(target_os = "macos", target_os = "linux"))`.
- Watch upstream for a Windows service implementation; the stub marks the work as pending.
Example fix
# before (Windows) sd-cli daemon install # -> Daemon auto-start is currently only supported on macOS and Linux. # after (Windows auto-start via Task Scheduler) schtasks /create /tn SpacedriveDaemon /tr 'C:\sd\sd-daemon.exe --data-dir C:\sd\data' /sc onlogon /rl limited
Defensive patterns
Strategy: validation
Validate before calling
fn autostart_supported() -> bool {
cfg!(any(target_os = "macos", target_os = "linux"))
}
if autostart_supported() { sd_daemon_install().await? } else { eprintln!("autostart unsupported; run sd-daemon manually"); } Type guard
pub fn autostart_supported() -> bool { cfg!(any(target_os = "macos", target_os = "linux")) } Try / catch
match install_autostart().await {
Err(e) if e.to_string().contains("only supported on macOS and Linux") => { /* expected on Windows; degrade gracefully */ }
other => other?,
} Prevention
- Gate `daemon install` behind an OS check in cross-platform scripts.
- On Windows use schtasks or a startup shortcut to run sd-daemon at logon.
- Treat this message as informational so CI matrices on Windows don't go red.
When it happens
Trigger: Building and running sd-cli on Windows and invoking `sd-cli daemon install`; compiling for another tier (e.g. FreeBSD) and calling the subcommand.
Common situations: Cross-platform users expecting auto-start parity; CI matrices that run the same command set on Windows runners.
Related errors
- Daemon binary not found at {}. Ensure both 'sd-cli' and 'sd-
- Failed to load LaunchAgent: {}
- Failed to enable systemd service: {}
- Failed to start systemd service: {}
- Failed to parse response: {}
AI-assisted analysis of spacedriveapp/spacedrive@6dfeccf211 (2026-08-16).
Data as JSON: /api/errors/dce753d84d73b7f7.
Report an issue: GitHub.