Skip to content

feat: Add Linux systemd support for service installation#88

Merged
evansenter merged 1 commit into
mainfrom
feat/linux-systemd-support
Jan 24, 2026
Merged

feat: Add Linux systemd support for service installation#88
evansenter merged 1 commit into
mainfrom
feat/linux-systemd-support

Conversation

@evansenter

Copy link
Copy Markdown
Owner

Summary

  • Ports cross-platform service management from claude-event-bus
  • On Linux, make install now works via systemd user services instead of failing with launchctl: command not found

Changes

New files:

  • scripts/claude-session-analytics.service - systemd unit template
  • scripts/install-systemd.sh - install user service
  • scripts/uninstall-systemd.sh - uninstall user service

Makefile updates:

  • install / uninstall / restart now detect OS via uname
  • macOS → LaunchAgent (unchanged)
  • Linux → systemd user service (new)

Test plan

  • make check passes
  • Test make install on Linux (systemd user service)
  • Test make restart on Linux
  • Test make uninstall on Linux

Closes #87

🤖 Generated with Claude Code

Port cross-platform service management from claude-event-bus:

New files:
- scripts/claude-session-analytics.service - systemd unit template
- scripts/install-systemd.sh - install user service
- scripts/uninstall-systemd.sh - uninstall user service

Makefile changes:
- install: OS detection (macOS → LaunchAgent, Linux → systemd)
- uninstall: OS detection for cleanup
- restart: OS detection for service restart

On Linux:
- make install → systemctl --user enable/start
- make restart → systemctl --user restart
- make uninstall → systemctl --user disable/stop

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@evansenter evansenter merged commit df4c0f5 into main Jan 24, 2026
3 checks passed
@evansenter evansenter deleted the feat/linux-systemd-support branch January 24, 2026 20:12
@claude

claude Bot commented Jan 24, 2026

Copy link
Copy Markdown

Prompt: evansenter/dotfiles/.../claude-review.md

Code Review

Summary

This PR adds Linux systemd support for the service installation, enabling make install, make restart, and make uninstall to work on Linux via systemd user services instead of failing with launchctl: command not found.

Issues Found

Critical

None

Important

  • scripts/dev.sh - The linked issue Add Linux systemd support for service installation #87 explicitly mentions that scripts/dev.sh should be updated to "add Linux branch for stopping/restarting systemd service". Currently, dev.sh uses macOS-only commands (launchctl, osascript) and will fail on Linux with command-not-found errors.

Suggestions

  • scripts/install-systemd.sh:22 - The macOS version creates mkdir -p "$HOME/.claude" while the systemd version creates mkdir -p "$HOME/.claude/contrib/analytics". This is fine but slightly inconsistent. The analytics subdirectory creation is more thorough, so this is actually an improvement - consider backporting to the macOS script separately.
  • scripts/uninstall-systemd.sh:27-28 - The uninstall script calls uninstall-cli.sh unconditionally without first defining SCRIPT_DIR. Looking at line 7, SCRIPT_DIR is defined, so this is actually fine - ignore this item. However, the script could print a cleaner "Note: Database preserved" message (currently says "~/.claude/contrib/analytics/data.db" which is correct).

Verdict

REQUEST_CHANGES - The scripts/dev.sh file was not updated for Linux support as specified in the linked issue #87. This is the only blocking issue; the rest of the implementation looks solid and well-structured.


Automated review by Claude Code

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.

Add Linux systemd support for service installation

1 participant