kordophoned: better daemon bootstrapping
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user