From c7b14b3a4d547bfbc9572ee4fd576aaa668277d4 Mon Sep 17 00:00:00 2001 From: Daniel Sauble Date: Thu, 16 Jul 2026 20:05:54 -0700 Subject: [PATCH] docs(services): document shutdown.timeout-seconds The service manager's 10 second grace period for shutdown.command was previously undocumented, and there was no way to extend it. Flox 1.14.0 adds shutdown.timeout-seconds to the manifest (flox/flox#4517). Co-Authored-By: Claude Fable 5 --- concepts/services.mdx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/concepts/services.mdx b/concepts/services.mdx index 95b8e56..3fc2211 100644 --- a/concepts/services.mdx +++ b/concepts/services.mdx @@ -59,6 +59,16 @@ vars.PGPORT = "9001" You can define a `shutdown.command` for any service, including services that do not run as daemons. Note that this pattern can have unpredictable effects in practice: it replaces the Flox service manager’s controlled `SIGTERM` → grace → `SIGKILL` shutdown path, which tracks the service’s PID, with the command that you define. And if your shutdown command fails to locate and kill the process for any reason, there's no fallback; the service never receives any signal and keeps running. +The service manager waits 10 seconds for `shutdown.command` to complete before giving up and sending `SIGKILL` to the process it is tracking. Some shutdown commands need longer than that — for example a command that stops a collection of containers. You can extend the wait by setting `shutdown.timeout-seconds`, which must be greater than zero and requires manifest `schema-version = "1.14.0"` or later: + +```toml +[services.supabase] +command = "supabase start" +is-daemon = true +shutdown.command = "supabase stop" +shutdown.timeout-seconds = 30 +``` + ## Starting services Services can be started automatically when you activate your environment via