Looking for Linux signal handling details for caddy

I believe there used to be this page with details: https://caddyserver.com/docs/cli#signals

But looks like it’s not available anymore?

I would like to know how caddy v2 reacts to:

  1. SIGTERM
  2. USR1
  3. USR2
  4. SIGINT

I am running caddy in a docker container.

# ./caddy version
v2.4.6 h1:HGkGICFGvyrodcqOOclHKfvJC0qTU7vny/7FhYp9hNw=

Related: No downtime Caddyfile reloads without watch?

Caddy initiates a graceful shutdown on SIGINT. A second SIGINT forces immediate exit.

SIGQUIT causes immediate exit after cleaning up locks.

SIGTERM is basically the same as SIGINT (but without the second-signal behavior).

I guess we don’t really have these documented, mostly because we don’t really use them. Ctrl+C is the most common use of signals (SIGINT) and that should be pretty intuitive anyway, I guess. For everything else there’s caddy reload and caddy stop and/or the API endpoints which are much more powerful/capable/flexible.

3 Likes

Well, we have it now :smiley:

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.