Running as PID 1 in a container, the daemon silently dropped SIGTERM, so `docker stop` always hit the 10s timeout and SIGKILL, and host reboots waited on it. The accept loop now polls a non-blocking listener and a shutdown flag registered via signal-hook. On SIGTERM or SIGINT it stops accepting, gives in-flight requests up to 3s to finish, removes the socket file, and exits with status 0. Log lines mark signal receipt and completion. Adds integration tests that spawn the binary, perform an auth round-trip, signal it, and assert a clean exit and socket removal. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kmrgkpp9YBJ6AMaWYPPZuD
17 lines
273 B
TOML
17 lines
273 B
TOML
[package]
|
|
name = "server"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
|
|
[dependencies]
|
|
clap = { workspace = true }
|
|
common = { workspace = true }
|
|
argon2 = "0.5.3"
|
|
env_logger = "0.11.8"
|
|
log = "0.4.29"
|
|
signal-hook = "0.4"
|
|
|
|
[[bin]]
|
|
name = "saslauthd"
|
|
path = "src/main.rs"
|