chore: add private-safe controller startup diagnostics
Add fixed startup branch labels and numeric apply exit status without relaxing startup guards or exposing private values. Cover shared launch/ACK and wrapper branches plus failed apply cleanup. Diagnostics only; the ACK publication race remains unchanged. Co-authored-by: GPT-6 <gpt-6@openai.com>
This commit is contained in:
1 parent
de453ed2c8
commit
ade3b89137
6 files changed
+131
-7
No files matched your search
@@ -61,11 +61,15 @@ if [ "${1-}" = --monitor ]; then
|
||||
[ "$#" -ge 3 ] || exit 64
|
||||
config_dir=$2
|
||||
shift 2
|
||||
proc_identity "$$" && [ "$proc_sid" = "$$" ] && [ "$$" -gt 1 ] || exit 78
|
||||
proc_identity "$$" || { echo 'controller-startup: wrapper=identity_unavailable' >&2; exit 78; }
|
||||
[ "$proc_sid" = "$$" ] && [ "$$" -gt 1 ] || {
|
||||
echo 'controller-startup: wrapper=not_session_leader' >&2; exit 78;
|
||||
}
|
||||
# Acknowledge the private session before exec, so even an immediate monitor
|
||||
# crash leaves its ownership recorded. No worker can precede this handshake.
|
||||
trap 'exit 143' INT TERM
|
||||
printf '%s\n' "$$" > "$config_dir/monitor-ready"
|
||||
echo 'controller-startup: wrapper=exec_pending' >&2
|
||||
exec "$@"
|
||||
elif [ "${1-}" = --watchdog ]; then
|
||||
set -eu
|
||||
|
||||
Reference in new issue
Block a user