Skip to content

Daemon uses launchctl unconditionally — crashes on Linux #1

@CalebisGross

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

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