Skip to content

fix: macOS service installer startup issues#44

Merged
aniongithub merged 1 commit into
mainfrom
fix/service-installer-issues
May 19, 2026
Merged

fix: macOS service installer startup issues#44
aniongithub merged 1 commit into
mainfrom
fix/service-installer-issues

Conversation

@aniongithub
Copy link
Copy Markdown
Owner

Fix three issues with the service installer on macOS:

  1. Don't use sudo for service stop on macOS. The service is a user LaunchAgent; sudo shifts the home directory to /var/root, causing kardianos/service to look for the plist in the wrong location. The stop fails silently, leaving the old service running on the default port, which forces the port-picker to choose a different port on reinstall.

  2. Set RunAtLoad=true in the launchd plist. kardianos/service defaults RunAtLoad to false, so the service wouldn't auto-start after reboot.

  3. Only print the listen address after service start when --addr was explicitly provided. Otherwise the output shows the flag default (4242) even though the installed plist may specify a different port.

Fix three issues with the service installer on macOS:

1. Don't use sudo for service stop on macOS. The service is a user
   LaunchAgent; sudo shifts the home directory to /var/root causing
   kardianos/service to look for the plist in the wrong location.
   The stop fails silently, leaving the old service running on the
   default port, which then forces the port-picker to choose a
   different port on reinstall.

2. Set RunAtLoad=true in the launchd plist. kardianos/service defaults
   RunAtLoad to false, so the service wouldn't auto-start after reboot.

3. Only print the listen address after 'service start' when --addr was
   explicitly provided. Otherwise the output shows the flag default
   (4242) even though the installed plist may specify a different port.
@aniongithub aniongithub merged commit 35d925d into main May 19, 2026
1 check passed
@aniongithub aniongithub deleted the fix/service-installer-issues branch May 19, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant