From 637e959c481ea4487292b0804fe949bf02e0bc7a Mon Sep 17 00:00:00 2001 From: gastown/polecats/rictus Date: Tue, 30 Dec 2025 22:09:35 -0800 Subject: [PATCH] Add Boot shutdown to gt down command (gt-xyzb5) Boot is spawned by the daemon as the Deacons watchdog. During shutdown Boot was never explicitly stopped. Now gt down stops Boot between Mayor and Deacon (step 3) to ensure clean shutdown. Generated with Claude Code Co-Authored-By: Claude Opus 4.5 --- internal/cmd/down.go | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/internal/cmd/down.go b/internal/cmd/down.go index 16504ce0..66dc910c 100644 --- a/internal/cmd/down.go +++ b/internal/cmd/down.go @@ -5,6 +5,7 @@ import ( "time" "github.com/spf13/cobra" + "github.com/steveyegge/gastown/internal/boot" "github.com/steveyegge/gastown/internal/daemon" "github.com/steveyegge/gastown/internal/events" "github.com/steveyegge/gastown/internal/style" @@ -22,6 +23,7 @@ This gracefully shuts down all infrastructure agents: • Witnesses - Per-rig polecat managers • Mayor - Global work coordinator + • Boot - Deacon's watchdog • Deacon - Health orchestrator • Daemon - Go background process @@ -79,7 +81,15 @@ func runDown(cmd *cobra.Command, args []string) error { printDownStatus("Mayor", true, "stopped") } - // 3. Stop Deacon + // 3. Stop Boot (Deacon's watchdog) + if err := stopSession(t, boot.SessionName); err != nil { + printDownStatus("Boot", false, err.Error()) + allOK = false + } else { + printDownStatus("Boot", true, "stopped") + } + + // 4. Stop Deacon if err := stopSession(t, DeaconSessionName); err != nil { printDownStatus("Deacon", false, err.Error()) allOK = false @@ -87,7 +97,7 @@ func runDown(cmd *cobra.Command, args []string) error { printDownStatus("Deacon", true, "stopped") } - // 4. Stop Daemon last + // 5. Stop Daemon last running, _, _ := daemon.IsRunning(townRoot) if running { if err := daemon.StopDaemon(townRoot); err != nil { @@ -100,7 +110,7 @@ func runDown(cmd *cobra.Command, args []string) error { printDownStatus("Daemon", true, "not running") } - // 5. Kill tmux server if --all + // 6. Kill tmux server if --all if downAll { if err := t.KillServer(); err != nil { printDownStatus("Tmux server", false, err.Error()) @@ -114,7 +124,7 @@ func runDown(cmd *cobra.Command, args []string) error { if allOK { fmt.Printf("%s All services stopped\n", style.Bold.Render("✓")) // Log halt event with stopped services - stoppedServices := []string{"daemon", "deacon", "mayor"} + stoppedServices := []string{"daemon", "deacon", "boot", "mayor"} for _, rigName := range rigs { stoppedServices = append(stoppedServices, fmt.Sprintf("%s/witness", rigName)) }