Skip to content

Auto-start can reload a service that slm serve uninstall is removing #337

Closed

Description

@varun369

Found in the review of #332. Not fixed there.

What happens. slm serve uninstall (and install) take the service-mutation lock (infra/service_mutation.serialized). The auto-start paths added in #332 do not: daemon_supervisor.request_start runs launchctl bootstrap + kickstart, systemctl --user start or schtasks /Run without it.

Scenario.

  1. slm serve uninstall starts: it unloads the job, then removes the definition file.
  2. Between those two steps, an MCP client auto-starts the daemon. find_job still sees the definition, job_state reports not_loaded, and request_start runs launchctl bootstrap on the file.
  3. Uninstall deletes the file and reports success. The job is loaded again, with no definition on disk, and the daemon runs under it.

The same window exists for a reinstall that replaces the definition: the client can load the old file after the installer unloaded it.

Expected. Auto-start takes the same lock for its service-manager calls, and skips the service (direct start) when an installer holds it, rather than waiting on it.

Where. cli/daemon_supervisor.py (request_start, _start_macos, _start_linux, _start_windows), infra/service_mutation.py.

Activity

  1. varun369 commented on Nov 20, 2026

    @varun369
    MemberAuthor

    Fixed in 4.2.33 (#346). Auto-start now takes the same service lock as slm serve install and uninstall, without waiting for it: while an installer holds the lock, auto-start answers busy and starts the daemon directly with the service's settings. Checked against a real launchd service: lock held → busy with no launchctl call; lock free → kickstarted. Upgrade with pip install -U superlocalmemory (or npm i -g superlocalmemory, or your plugin channel), then slm restart.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions