atuinsh/atuin · error

failed to register sigint handler

Error message

failed to register sigint handler

What it means

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.

Solutions

  1. Run the daemon under a full tokio runtime with the `signal` feature enabled
  2. Raise RLIMIT_SIGPENDING if signal registrations are failing due to limits
  3. Check for a seccomp profile blocking rt_sigaction
  4. Update tokio to a current version

Example fix

// Cargo.toml
// before
tokio = { version = "1", features = ["rt"] }
// after
tokio = { version = "1", features = ["rt-multi-thread", "macros", "signal"] }
Defensive patterns

Strategy: try-catch

Try / catch

let mut int = tokio::signal::unix::signal(SignalKind::interrupt())
    .map_err(|e| BootError::SignalHandler(e))?;

Prevention

When it happens

Trigger: `SignalKind::interrupt()` handler registration failing during daemon `boot()` — signal driver unavailable, runtime misconfigured, or process signal limits hit.

Common situations: Running the daemon with a tokio runtime lacking the signal/io driver; environments where SIGINT handling is restricted; resource exhaustion of pending signals.

Related errors


AI-assisted analysis of atuinsh/atuin@c0c717ab04 (2026-09-12). Data as JSON: /api/errors/f0f0a0d8586903eb. Report an issue: GitHub.

Appendix: source

Thrown at crates/atuin-daemon/src/lib.rs:137

    .await?;

    // Run the daemon event loop
    daemon.run_event_loop().await?;

    // Stop all components on shutdown
    daemon.stop_components().await;

    tracing::info!("daemon shut down complete");
    Ok(())
}

/// Wait for a shutdown signal (Ctrl+C or SIGTERM).
#[cfg(unix)]
async fn shutdown_signal() {
    let mut term = tokio::signal::unix::signal(tokio::signal::unix::SignalKind::terminate())
        .expect("failed to register sigterm handler");
    let mut int = tokio::signal::unix::signal(tokio::signal::unix::SignalKind::interrupt())
        .expect("failed to register sigint handler");

    tokio::select! {
        _ = term.recv() => {},
        _ = int.recv() => {},
    }
}

/// Wait for a shutdown signal (Ctrl+C).
#[cfg(not(unix))]
async fn shutdown_signal() {
    tokio::signal::ctrl_c().await.expect("failed to listen for ctrl+c");
}

View on GitHub (pinned to c0c717ab04)