Skip to main content

Module daemon

Module daemon 

Source
Expand description

Daemon subsystem: in-process supervision of one ccs-proxy per upstream URL.

See docs/superpowers/specs/2026-05-28-cc-switch-daemon-design.md for design.

Re-exports§

pub use commands::DaemonAction;
pub use commands::handle_daemon_command;

Modules§

aggregate
commands
fork
Unix double-fork into background for daemon process isolation.
lifecycle
Daemon main loop: spawn proxies, write state, supervise, shutdown.
logging
pidfile
Pidfile primitives and process-liveness checks for the daemon supervisor.
state
status

Enums§

ProxyResolution
Result of attempting to resolve a proxy URL for a given upstream.

Functions§

print_version_mismatch_warning
Print the version-mismatch warning in red, if one applies. No-op otherwise.
try_resolve_proxy
Check whether the daemon is alive and has a proxy for the given upstream URL. Returns the proxy URL (http://127.0.0.1:) if available, otherwise Direct.
version_mismatch_warning
If the daemon is alive but was started by a cc-switch binary whose version differs from this one, return a warning message. Returns None when the daemon is stopped or its version matches the current binary.