Caddy.Supervisor (Caddy v2.3.1)

View Source

Main supervisor for the Caddy subsystem.

Manages the Caddy configuration, logging, and server processes using a rest_for_one strategy to ensure proper restart ordering.

Supervision Tree

The rest_for_one strategy ensures that if the ConfigProvider crashes, all subsequent children are restarted. If the ConfigManager crashes, Logger and Server are restarted.

Summary

Functions

Returns a specification to start this module under a supervisor.

Restart the Caddy Server child process.

Start the Caddy supervisor.

Stop the Caddy supervisor.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

restart_server()

@spec restart_server() :: {:ok, pid()} | {:ok, :undefined} | {:error, term()}

Restart the Caddy Server child process.

Returns {:ok, pid()} on successful restart, or {:error, term()} on failure.

start_link(args)

@spec start_link(Keyword.t()) :: :ignore | {:error, any()} | {:ok, pid()}

Start the Caddy supervisor.

Options

  • :caddy_bin - Path to the Caddy binary (optional)

stop(reason \\ :normal)

@spec stop(term()) :: :ok

Stop the Caddy supervisor.