Initial commit
- rough filestructure - first simplistic daemon
This commit is contained in:
+41
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// Husk milter
|
||||
//
|
||||
|
||||
use std::{
|
||||
env,
|
||||
process,
|
||||
};
|
||||
|
||||
pub mod config;
|
||||
use config::HuskConfig;
|
||||
pub mod types;
|
||||
|
||||
pub mod daemon;
|
||||
use daemon::Daemon;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
|
||||
let config_file = env::args().nth(1).expect("config file missing");
|
||||
let husk_config = HuskConfig::load(&config_file);
|
||||
|
||||
if husk_config.is_none() {
|
||||
eprintln!("Cannot load configuration");
|
||||
process::exit(1);
|
||||
}
|
||||
let husk_config = husk_config.unwrap();
|
||||
|
||||
log4rs::init_file(husk_config.logfile_config(), Default::default()).unwrap();
|
||||
|
||||
log::info!("starting...");
|
||||
|
||||
match Daemon::run().await {
|
||||
Ok(_) => {
|
||||
println!("exiting...");
|
||||
},
|
||||
Err(e) => {
|
||||
println!("exit with {:?}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user