Private
Public Access
1
0

kordophoned: better daemon bootstrapping

This commit is contained in:
2025-04-25 16:54:37 -07:00
parent b1f171136a
commit 0c6b55fa38
7 changed files with 202 additions and 67 deletions

View File

@@ -2,7 +2,6 @@ mod dbus;
mod daemon;
use std::future;
use std::sync::Arc;
use log::LevelFilter;
use daemon::Daemon;
@@ -19,9 +18,15 @@ fn initialize_logging() {
async fn main() {
initialize_logging();
// Daemon is stored in an Arc so it can be shared with other endpoints eventually.
let daemon = Arc::new(Daemon::new());
// Create the daemon
let daemon = Daemon::new()
.map_err(|e| {
log::error!("Failed to start daemon: {}", e);
std::process::exit(1);
})
.unwrap();
// Create the D-Bus endpoint
let endpoint = DbusEndpoint::new(daemon);
endpoint.start().await;