feat(scripts): Linux systemd support for maintain.sh#36
Open
abdout wants to merge 2 commits into
Open
Conversation
Closes the cross-platform scheduling gap. macOS uses launchd
(existing); Linux now uses systemd --user units. bootstrap.sh
step 15 no longer warns 'Linux not supported' — it just calls
maintain.sh --install and the script handles the backend choice.
maintain.sh changes:
- OS detection sets IS_MAC / IS_LINUX flags at top
- --install branches: macOS writes ~/Library/LaunchAgents/com.databayt.kun-maintain.plist;
Linux writes ~/.config/systemd/user/kun-maintain.{service,timer}
and runs 'systemctl --user enable --now kun-maintain.timer'
- --uninstall branches similarly
- --status shows 'Backend: launchd' or 'Backend: systemd --user'
with 'Next run' from 'systemctl --user list-timers' on Linux
- systemd timer uses OnCalendar=*-*-* HH:MM:00 + Persistent=true
(catches missed runs after laptop sleep, same as launchd)
- Graceful degradation: systemctl missing → exit 5 with hint to use cron
bootstrap.sh changes:
- Step 15 no longer branches on IS_LINUX — delegates to maintain.sh
bash -n syntax-clean. Linux systemd validation needs a Linux machine.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Both sync-repos.ps1 and sync-repos.sh printed 'Cloned successfully' unconditionally after 'git clone', ignoring the exit code. Surfaced on a real bootstrap run: hogwarts appeared to clone (the log said 'Cloned successfully'), but the directory wasn't on disk afterward. git clone had failed partway through with no error surfaced. - PowerShell: check $LASTEXITCODE and Test-Path before claiming success - Bash: use 'if git clone …' so the success branch only fires on exit 0 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the last cross-platform gap — Linux now has scheduling parity.
maintain.shpicks the right backend (launchd on macOS, systemd --user on Linux), sobootstrap.shstep 15 works everywhere without OS-specific branching.What's in the PR
~/.claude/scripts/maintain.sh— OS detection, dual-backend install/uninstall/status~/.claude/scripts/bootstrap.sh— drops the 'Linux not supported' warning at step 15How it picks the backend
launchd~/Library/LaunchAgents/com.databayt.kun-maintain.plist(loaded vialaunchctl)systemd --user~/.config/systemd/user/kun-maintain.{service,timer}(enabled viasystemctl --user enable --now)systemd timer detail
--status output examples
macOS:
Linux:
Test plan
bash -n maintain.shpassesbash -n bootstrap.shpassesbash maintain.sh --statuson this Windows machine (Git Bash) correctly degrades — neither macOS nor Linux branch firesmaintain.sh --installwrites service + timer,systemctl --user list-timersshows itmaintain.sh --uninstalldisables + removes; idempotentDependencies
Stacks on
feat/bootstrap-sh(PR #35). Final merge order:🤖 Generated with Claude Code