diff --git a/noxis-rs/src/options/preboot.rs b/noxis-rs/src/options/preboot.rs index 245db0c..78463c7 100644 --- a/noxis-rs/src/options/preboot.rs +++ b/noxis-rs/src/options/preboot.rs @@ -3,6 +3,7 @@ //! #[allow(unused_imports)] use anyhow::{Result, Error}; +use log::warn; use std::path::PathBuf; use std::env::var; use dotenv::dotenv; @@ -187,6 +188,7 @@ pub struct PrebootParams { pub remote_server_url : String, pub config : PathBuf, pub metrics: MetricsPrebootParams, + pub self_socket : PathBuf, } /// # implementation for `MetricsPrebootParams` @@ -251,6 +253,16 @@ impl PrebootParams { Err(_) => MetricsPrebootParams::Full, } }, + self_socket : { + match var("NOXIS_SOCKET_PATH") { + Ok(val) => PathBuf::from(val), + Err(_) => { + let default = std::env::current_dir().expect("Crushed on getting current_dir path. Check fs state!"); + warn!("$NOXIS_SOCKET_PATH wans't set. Default value - {}", default.display()); + PathBuf::from(default) + }, + } + }, } } }