1021219d4a
The previous tokio = { features = ["full"] } pulled in tokio::signal
(including tokio::signal::unix::SignalKind::terminate). On Redox the
libc signal-handler registration path is incomplete; calling
enable_all() in main triggered a protection fault inside relibc, and
the kernel then panicked on unreachable code in
process::exit_this_context (see kernel/src/syscall/process.rs:79).
Two-part fix:
- Cargo.toml: scope tokio features to rt, rt-multi-thread, macros,
net, time, sync. This drops and , which are
unavailable on Redox anyway. The init system manages the daemon
lifecycle, so a signal handler is not needed in this daemon.
- src/main.rs: spawn_signal_handler becomes a no-op. The shutdown_tx
channel is preserved for any future internal shutdown signaling.
The SIGTERM path is removed entirely.
This unblocks Phase 2.1 by removing the kernel panic cascade: the
protection fault no longer fires, the kernel's exit_this_context
reaches the context switch cleanly, and the previous
unreachable!() panic no longer triggers.
21 lines
828 B
TOML
21 lines
828 B
TOML
[package]
|
|
name = "redbear-upower"
|
|
version = "0.3.0"
|
|
edition = "2024"
|
|
|
|
[[bin]]
|
|
name = "redbear-upower"
|
|
path = "src/main.rs"
|
|
|
|
[dependencies]
|
|
zbus = { version = "5", default-features = false, features = ["tokio"] }
|
|
# Minimal tokio feature set. Avoids the unstable tokio::signal::unix
|
|
# backend on Redox (the `signal` feature pulls in libc::kill and a
|
|
# signal-handler registration path that is not fully implemented in
|
|
# relibc, and a page fault on `enable_all()` was observed during
|
|
# redbear-upower startup). Redox manages daemon lifecycle through the
|
|
# init system, not POSIX signals, so a signal handler is not needed
|
|
# here. Macros are enabled for tokio::select! and tokio::pin!.
|
|
tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros", "net", "time", "sync"] }
|
|
serde = { version = "1", features = ["derive"] }
|