launchd-exit78-exconfig-debug
Skill0 starsChanged 5 months agoMITView on GitHub
launchd ジョブが「last exit code = 78 (EX_CONFIG)」で KeepAlive クラッシュループする時の診断と修復。プロセスが一切起動せずログも残らない spawn 段階失敗が対象。agentmemory が6日間で15,000回ループした実例(2026-06-11)から抽出。
In this repository99 other files it gives its agents.
- agents-tools-quoted-jsonSkill
- asc-api-app-store-submitSkill
- asd-ste100Skill
- automation-bool-selector-pitfallsSkill
- automation-stale-cooldown-flagSkill
- autonomous-build-verifySkill
- book-to-skillSkill
- ccusage-cli-cost-trackingSkill
- chrome-ext-mv3-programmatic-injectSkill
- chrome-ext-store-assetsSkill
- claude-headless-p-invocationSkill
- claude-plugin-context-auditSkill
- claude-session-log-to-kbSkill
- cloudflare-workers-do-deploySkill
- codebase-to-courseSkill
- codesign-keychain-prompt-fixSkill
- codex-cli-setupSkill
- codex-delegation-handoffSkill
- content-factory-grounding-dedupSkill
- conversation-log-append-patternSkill
- cron-to-launchd-macosSkill
- cross-automation-shared-resource-killSkill
- design-token-migration-rnSkill
- discord-bot-image-to-claudeSkill
- discord-gateway-resume-dedupSkill
- excel-filtered-url-http-auditSkill
- execution-budget-vs-capsSkill
- expo-free-local-ios-testflightSkill
- ga4-connect-projectsSkill
- gcal-oauth-desktop-setupSkill
- git-commit-helperSkill
- git-prepush-secret-remote-checkSkill
- gsc-cli-automationSkill
- hatena-blogsync-autopostSkill
- hook-latency-wrapSkill
- hook-log-append-patternSkill
- html-to-pdf-slide-deckSkill
- humanizerSkill
- human-review-gate-shellSkill
- implementation-model-routingSkill
- insights-to-claude-mdSkill
- ios-permission-key-security-matrixSkill
- ios-sim-store-screenshotsSkill
- llm-content-pipeline-quality-gateSkill
- local-ai-video-pipelineSkill
- local-flux-mflux-image-genSkill
- local-llm-slow-diagnosisSkill
- local-music-generationSkill
- lottie-skottie-authoring-pitfallsSkill
- machine-wide-api-ratelimit-latchSkill
- macos-hook-path-timeoutSkill
- md-to-docx-reportSkill
- memory-md-inject-bloat-auditSkill
- message-display-secrets-maskSkill
- metric-source-attributionSkill
- migrate-icloud-desktop-assetsSkill
- nextauth-local-e2e-sessionSkill
- nextjs-rsc-payload-slimSkill
- nothing-designSkill
- openclaw-ollama-setupSkill
- The first 60 shown.
The file
Files
launchd exit 78 (EX_CONFIG) クラッシュループの診断と修復
Procedure
- 状態確認:
launchctl print gui/501/<label>でstate = spawn scheduled/runs = 大きい数/last exit code = 78: EX_CONFIGを確認。runs が数秒おきに増えていればクラッシュループ。 - 「spawn 段階の失敗」と確定: 78 はアプリの exit ではなく launchd 合成の「Service could not initialize」。StandardOut/ErrPath のログが一切成長していない(mtime 凍結)ことが裏付け。手動でスクリプトを実行して正常起動するなら、プログラムは健全で launchd 配下のみ失敗している。
- 健常ジョブと plist を差分比較。今回の実例で効いた3軸:
- ログパスが TCC 保護領域(~/Documents, ~/Desktop 等)→
~/.claude/logs/や~/Library/Logs/へ変更(最有力) - shebang
#!/usr/bin/env bashが plist の PATH で unsigned な Homebrew bash に解決される → ProgramArguments を["/bin/bash", "script.sh"]に変更(Apple署名インタプリタ明示) launchctl printの properties に健常ジョブはmanaged LWCR | has LWCR、失敗ジョブはhas LWCR欠落 → 再bootstrapでLWCR再生成
- ログパスが TCC 保護領域(~/Documents, ~/Desktop 等)→
- アプリが相対パスでデータを書く場合は
WorkingDirectoryを明示(launchd 既定 cwd は/、MCP shim 起動だと/tmpになり再起動でデータ全損する)。 - 修復手順(順序が重要): plist 編集 →
launchctl bootout gui/501/<label>(ループ停止)→ ポートを掴んでいる孤児プロセスをlsof -nP -iTCP:<port> -sTCP:LISTENで所有者を再確認してから kill →launchctl bootstrap gui/501 <plist>→launchctl printでstate = running/ runs が増えないこと、ログ成長、ポートLISTENを検証。
Pitfalls
- ポートが開いていても安心しない: エンジンだけ生きて worker 不在の「半生」状態は全エンドポイント 404 を返す。死活はポートでなく health エンドポイントの HTTP 200 で見る。
KeepAlive=trueは spawn 失敗を直さない。ThrottleInterval を 30s 程度入れないと数秒間隔の無限ループで runs が数万に積み上がる。- plist を
plutil -extract ... -o -で調べる時、-oの引数を間違えると元の plist を出力で上書き破壊する(vault-auto-ingest が76バイトのJSON断片になった実例)。調査系 plutil は必ず-o -(stdout)か別ファイルへ。 - 再現実行(手動でスクリプトを試す)が孤児プロセスを残してポートを占有し、launchd 復旧を妨げることがある。修復前に
lsofで掃除。
Verification
launchctl print gui/501/<label> | grep -E 'state =|runs =|last exit' # running / runs=1 / never exited
lsof -nP -iTCP:<port> -sTCP:LISTEN # 所有者が launchd 起動の正規プロセス
curl -s -o /dev/null -w '%{http_code}' http://localhost:<port>/<health> # 200Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

