{"record":{"id":"f0f0a0d8586903eb","repo":"atuinsh/atuin","slug":"failed-to-register-sigint-handler","errorCode":null,"errorMessage":"failed to register sigint handler","messagePattern":"failed to register sigint handler","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/atuin-daemon/src/lib.rs","lineNumber":137,"sourceCode":"    .await?;\n\n    // Run the daemon event loop\n    daemon.run_event_loop().await?;\n\n    // Stop all components on shutdown\n    daemon.stop_components().await;\n\n    tracing::info!(\"daemon shut down complete\");\n    Ok(())\n}\n\n/// Wait for a shutdown signal (Ctrl+C or SIGTERM).\n#[cfg(unix)]\nasync fn shutdown_signal() {\n    let mut term = tokio::signal::unix::signal(tokio::signal::unix::SignalKind::terminate())\n        .expect(\"failed to register sigterm handler\");\n    let mut int = tokio::signal::unix::signal(tokio::signal::unix::SignalKind::interrupt())\n        .expect(\"failed to register sigint handler\");\n\n    tokio::select! {\n        _ = term.recv() => {},\n        _ = int.recv() => {},\n    }\n}\n\n/// Wait for a shutdown signal (Ctrl+C).\n#[cfg(not(unix))]\nasync fn shutdown_signal() {\n    tokio::signal::ctrl_c().await.expect(\"failed to listen for ctrl+c\");\n}\n","sourceCodeStart":119,"sourceCodeEnd":150,"githubUrl":"https://github.com/atuinsh/atuin/blob/c0c717ab04c881764bcad4b3d169a507e2432643/crates/atuin-daemon/src/lib.rs#L119-L150","documentation":"Same registration failure as the SIGTERM case, but for the SIGINT (Ctrl+C) handler in `shutdown_signal()`. Tokio could not create the interrupt signal event source, so the daemon cannot react to Ctrl+C.","triggerScenarios":"`SignalKind::interrupt()` handler registration failing during daemon `boot()` — signal driver unavailable, runtime misconfigured, or process signal limits hit.","commonSituations":"Running the daemon with a tokio runtime lacking the signal/io driver; environments where SIGINT handling is restricted; resource exhaustion of pending signals.","solutions":["Run the daemon under a full tokio runtime with the `signal` feature enabled","Raise RLIMIT_SIGPENDING if signal registrations are failing due to limits","Check for a seccomp profile blocking rt_sigaction","Update tokio to a current version"],"exampleFix":"// Cargo.toml\n// before\ntokio = { version = \"1\", features = [\"rt\"] }\n// after\ntokio = { version = \"1\", features = [\"rt-multi-thread\", \"macros\", \"signal\"] }","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"let mut int = tokio::signal::unix::signal(SignalKind::interrupt())\n    .map_err(|e| BootError::SignalHandler(e))?;","preventionTips":["Same as SIGTERM: full tokio runtime with signal feature","Verify seccomp profiles allow rt_sigaction","Test daemon boot inside the target container image, not just on dev machines"],"tags":["signal","tokio","panic","daemon"],"backgroundTag":"module-init-failed","analyzedSha":"c0c717ab04c881764bcad4b3d169a507e2432643","analyzedAt":"2026-09-12T07:40:01.341Z","contentChangedAt":"2026-09-12T07:40:01.341Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}