{"record":{"id":"4f84a20afd541dd3","repo":"vectordotdev/vector","slug":"failed-to-set-up-sighup-handler","errorCode":null,"errorMessage":"Failed to set up SIGHUP handler.","messagePattern":"Failed to set up SIGHUP handler\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/signal.rs","lineNumber":200,"sourceCode":"        for shutdown_tx in self.shutdown_txs.drain(..) {\n            // An error just means the channel was already shut down; safe to ignore.\n            _ = shutdown_tx.send(());\n        }\n    }\n}\n\n/// Signals from OS/user.\n#[cfg(unix)]\nfn os_signals(runtime: &Runtime) -> impl Stream<Item = SignalTo> + use<> {\n    use tokio::signal::unix::{SignalKind, signal};\n\n    // The `signal` function must be run within the context of a Tokio runtime.\n    runtime.block_on(async {\n        let mut sigint = signal(SignalKind::interrupt()).expect(\"Failed to set up SIGINT handler.\");\n        let mut sigterm =\n            signal(SignalKind::terminate()).expect(\"Failed to set up SIGTERM handler.\");\n        let mut sigquit = signal(SignalKind::quit()).expect(\"Failed to set up SIGQUIT handler.\");\n        let mut sighup = signal(SignalKind::hangup()).expect(\"Failed to set up SIGHUP handler.\");\n\n        async_stream::stream! {\n            loop {\n                let signal = tokio::select! {\n                    _ = sigint.recv() => {\n                        info!(message = \"Signal received.\", signal = \"SIGINT\");\n                        SignalTo::Shutdown(None)\n                    },\n                    _ = sigterm.recv() => {\n                        info!(message = \"Signal received.\", signal = \"SIGTERM\");\n                        SignalTo::Shutdown(None)\n                    } ,\n                    _ = sigquit.recv() => {\n                        info!(message = \"Signal received.\", signal = \"SIGQUIT\");\n                        SignalTo::Quit\n                    },\n                    _ = sighup.recv() => {\n                        info!(message = \"Signal received.\", signal = \"SIGHUP\");","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/vectordotdev/vector/blob/3708c39b12a93212ed8b8d7510b4cc7769cb5864/src/signal.rs#L182-L218","documentation":"Vector registers a SIGHUP handler (configuration reload signal) via tokio::signal::unix::signal(SignalKind::hangup()) and unwraps the io::Result with expect. If registration fails in the execution environment, Vector panics during startup and never becomes reloadable via SIGHUP.","triggerScenarios":"Starting Vector where SIGHUP registration fails: sandboxed runtimes blocking sigaction/signalfd, exhausted fd/handler budgets, or platforms/environments (some jails, minimal emulators) that disallow SIGHUP streams.","commonSituations":"Strict container security profiles; process managers that swallow SIGHUP; test environments creating many Tokio runtimes.","solutions":["Allow signal syscalls in the container security profile or use the default profile","Increase RLIMIT_NOFILE if registration fails from fd pressure","Reload configuration through Vector's API instead of SIGHUP where the environment cannot deliver it","Confirm the panic reproduces only inside the restricted environment"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"ulimit -n 65536\nvector validate /etc/vector/vector.toml && vector --config /etc/vector/vector.toml","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the runtime environment permissive for signal registration (default seccomp)","Use Vector's admin API for reloads in environments where SIGHUP cannot be delivered","Avoid supervisors that consume or mask SIGHUP before Vector sees it"],"tags":["rust","vector","tokio","signals","unix","sighup","panic"],"backgroundTag":"signal-handler-registration-failed","analyzedSha":"3708c39b12a93212ed8b8d7510b4cc7769cb5864","analyzedAt":"2026-08-20T07:02:18.786Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T20:17:18.057Z"}