Spaces:
Sleeping
Sleeping
Instrument the start hook to find where the server is lost
Browse filesCo-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
.devcontainer/devcontainer.json
CHANGED
|
@@ -55,10 +55,10 @@
|
|
| 55 |
// Runs on create *and* on every resume from an idle stop, which is what makes the codespace
|
| 56 |
// behave like a server rather than a dev box you have to restart by hand.
|
| 57 |
//
|
| 58 |
-
//
|
| 59 |
-
//
|
| 60 |
-
//
|
| 61 |
-
"postStartCommand": "setsid nohup ${containerWorkspaceFolder}/.devcontainer/start-opencode.sh > /tmp/opencode.log 2>&1 < /dev/null & echo
|
| 62 |
|
| 63 |
"customizations": {
|
| 64 |
"vscode": {
|
|
|
|
| 55 |
// Runs on create *and* on every resume from an idle stop, which is what makes the codespace
|
| 56 |
// behave like a server rather than a dev box you have to restart by hand.
|
| 57 |
//
|
| 58 |
+
// Diagnostic build: records whether the detached server is still alive after the hook
|
| 59 |
+
// returns, because a hook that launches a process and then loses it looks identical to one
|
| 60 |
+
// that never ran.
|
| 61 |
+
"postStartCommand": "bash -c 'D=/tmp/hook.log; { echo \"--- hook $(date -Is)\"; command -v setsid || echo \"no setsid\"; } >> $D 2>&1; setsid nohup ${containerWorkspaceFolder}/.devcontainer/start-opencode.sh >> /tmp/opencode.log 2>&1 < /dev/null & P=$!; echo \"launched pid=$P\" >> $D; sleep 5; if kill -0 $P 2>/dev/null; then echo \"alive after 5s\" >> $D; else echo \"DEAD after 5s\" >> $D; fi; pgrep -f opencode >> $D 2>&1 || echo \"no opencode process\" >> $D'",
|
| 62 |
|
| 63 |
"customizations": {
|
| 64 |
"vscode": {
|