Fix acme-ollie-ensure: use existing namespace paths
session/$S/id and agent/$A/id don't exist in the 9P namespace. Use env and cfg which do exist, fixing OllieHere and all acme scripts.
This commit is contained in:
parent
c6c4651446
commit
aae861adae
|
|
@ -116,8 +116,8 @@ Background processes have no timeout — they run until they exit, you stop them
|
|||
**Rules**:
|
||||
- Use background for long operations (builds, test suites, deployments, log tailing). Do NOT background short commands (< 5s).
|
||||
- React to `<system-proc-interrupt>` naturally. If a build fails, fix it. If output is irrelevant, stop the process.
|
||||
- Stop background processes: `client_9p(op="write", path="session/$OLLIE_SESSION_ID/agent/$OLLIE_UNAME/proc/<id>/ctl", data="term")` (use `kill` instead of `term` to force-kill)
|
||||
- Read full output: `client_9p(op="read", path="session/$OLLIE_SESSION_ID/agent/$OLLIE_UNAME/proc/<id>/out")`
|
||||
- Stop background processes: `client_9p(op="rdwr", path="session/$OLLIE_SESSION_ID/agent/$OLLIE_UNAME/ctl", data="proc term <id>")` (use `kill` instead of `term` to force-kill)
|
||||
- Read full output: `client_9p(op="rdwr", path="session/$OLLIE_SESSION_ID/agent/$OLLIE_UNAME/ctl", data="proc out <id>")`
|
||||
|
||||
# Security
|
||||
|
||||
|
|
|
|||
|
|
@ -37,12 +37,12 @@ agent_hash=$(printf '%s' "$cwd" | md5sum | cut -c1-8)
|
|||
AGENT="$agent_hash"
|
||||
|
||||
# Ensure session exists
|
||||
if ! ollie-9p read "session/$SESSION/id" >/dev/null 2>&1; then
|
||||
if ! ollie-9p read "session/$SESSION/env" >/dev/null 2>&1; then
|
||||
printf 'name=%s\ncwd=%s\n' "$SESSION" "$cwd" | ollie-9p write "session/new" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# Ensure agent exists
|
||||
if ! ollie-9p read "session/$SESSION/agent/$AGENT/id" >/dev/null 2>&1; then
|
||||
if ! ollie-9p read "session/$SESSION/agent/$AGENT/cfg" >/dev/null 2>&1; then
|
||||
printf 'name=%s\ncwd=%s\n' "$AGENT" "$cwd" | ollie-9p write "session/$SESSION/agent/new" 2>/dev/null || true
|
||||
else
|
||||
# Update cwd if agent already exists
|
||||
|
|
|
|||
Loading…
Reference in New Issue