Skip to content

Daemon uses launchctl unconditionally — crashes on Linux #1

Closed

Description

@CalebisGross

Problem

internal/daemon/daemon.go lines 152-193 call launchctl (macOS-only) with no platform guard:

  • IsServiceInstalled() — runs launchctl list
  • IsServiceRunning() — parses launchctl list output
  • StopService() / StartService() — run launchctl commands

cmd/mnemonic/main.go lines 163-188 call these functions unconditionally in startCommand().

On Linux, launchctl doesn't exist, so these calls fail with "executable file not found".

Impact

mnemonic start crashes on Linux. Users must use mnemonic serve (foreground) as a workaround.

Fix

Add runtime.GOOS checks or use build-tag-separated files:

  • internal/daemon/service_darwin.go — existing launchctl code
  • internal/daemon/service_linux.go — systemd unit file + systemctl
  • internal/daemon/service.go — platform-agnostic interface

Activity

  1. CalebisGross commented on Feb 28, 2026

    @CalebisGross
    CollaboratorAuthor

    Resolved by #19 (platform-abstracted ServiceManager with Linux systemd support) and #20 (log directory fix for fresh installs).

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions