Does livekit-agent support graceful shutdown?
# ask-ai
b
Does livekit-agent support graceful shutdown?
✅ 1
t
Thanks for reaching out, Jura. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — good question about graceful shutdown for the livekit-agent. Yes — livekit-agent supports graceful shutdown. Key points: • Shutdown is triggered by SIGTERM or SIGINT; the agent stops accepting new jobs and lets in-flight jobs finish. • A
drain_timeout
controls how long the agent waits for active jobs before exiting. It defaults to 30 minutes (1800s) and is configurable. • In production (
start
) mode, graceful shutdown (drain period) is enabled by default. In
dev
mode, the drain period is skipped for faster restarts. • For self-hosted setups, ensure the agent process receives the signal directly (use
exec
in wrapper scripts) so signals aren’t blocked. If you’d like, tell me how you run the agent (Docker, systemd, Kubernetes, or a wrapper script) and I’ll give exact steps or config snippets for clean shutdown. Sources: Deployment reliability on LiveKit Cloud | LiveKit | Server options | LiveKit Documentation, with interactive elements