Skip to content

Windows: per-user background service for the capture daemon #5

Description

@nullarch

The capture daemon runs as a per-user service on macOS (launchd) and Linux (systemd --user). On Windows it is not implemented: crates/attemptdb-capture/src/service.rs returns

daemon service registration is not implemented on Windows yet (planned: a per-user autostart entry under HKCU\Software\Microsoft\Windows\CurrentVersion\Run running attempt daemon run)

Without it, hooks on Windows still capture (they append to the spool and exit — that path is platform-independent), but nothing imports the spool or uploads in the background until the user runs a command by hand.

What to do

Implement install_service / uninstall_service / restart_service for Windows in service.rs, behind the existing cfg. The planned approach is a per-user Run registry entry; a Scheduled Task is the alternative and may be better because it can restart on failure — argue for one in the PR.

  • No new dependency if possible (windows-sys is a large surface; a schtasks.exe invocation may be enough — the same shape as the launchctl/systemctl calls already there).
  • attempt daemon status must report the real state, and attempt uninstall must remove the registration.

Done when

attempt daemon install on Windows 10/11 survives a logout/login, and attempt doctor shows the daemon running.

Needs a Windows machine — that is why it is open. See TODO.md §21.4.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededplatformWindows, Linux, or macOS specific

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions