{"version":"2.1.299","anchor":"self-hosted-runner-sigterm-drain-with-shutdown-drain-sec","canonical_anchor":"self-hosted-runner-sigterm-drain-with-shutdown-drain-sec","heading":"Self-hosted runner gains a shutdown drain and tool-server sessions","tier":"use","area":"Self-Hosted Runner","scope":"org","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.299\/e\/self-hosted-runner-sigterm-drain-with-shutdown-drain-sec","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.299","markdown":"### Self-hosted runner gains a shutdown drain and tool-server sessions\n\nThe self-hosted runner can wait up to --shutdown-drain-sec seconds for running work on SIGTERM, and supports a tool-server session kind\n\n**What**\n\nA self-hosted runner is a program you run on your own machines to pick up and run Claude Code sessions. It has a new `--shutdown-drain-sec <n>` option, stored as `shutdownDrainMs`.\n\n- On the first SIGTERM (the usual stop signal), the runner stops looking for new work. The work already being fetched and any running hooks get up to n seconds to finish. Hooks are user-set commands that run at certain moments.\n\n- A second signal, or SIGINT (Ctrl+C), stops whatever is still running.\n\n- The value must be a whole number of seconds from 0 to 3600. The default is 0, which turns the drain off and stops work at once.\n\n- The runner logs its drain behaviour and warns if `--shutdown-drain-sec` is less than the hook timeout plus a margin.\n\n- The runner supports a 'tool-server' session kind with its own `.tool-server-config` folder. Before, only `.claude-config` was listed.\n\nBefore, the first signal stopped everything at once and a second one forced the exit.\n\n**Why**\n\nOperators can restart or roll out runners without cutting off sessions and hooks that are still running, as long as the drain time is long enough.\n\n- Area: Self-Hosted Runner\n- Tier: Use it now\n- Useful: 5\/5\n- Signal: 3\/5\n- Scope: org\n- Heads-up: no"}