Compare commits

...

2 Commits

Author SHA1 Message Date
prplV 7e0d22d4e0 fixed issue#18 2025-01-13 13:18:20 +03:00
prplV 3d12137052 useless log deleted 2025-01-13 12:52:36 +03:00
2 changed files with 14 additions and 3 deletions

View File

@ -201,7 +201,6 @@ fn once_get_remote_configuration(serv_info: &str) -> Option<Processes> {
} }
}, },
Err(_) => { Err(_) => {
warn!("Cannot get config from Redis Server. Empty channel");
None None
}, },
} }

View File

@ -4,6 +4,8 @@ use anyhow::{Result, Ok, Error};
use clap::Parser; use clap::Parser;
use std::path::PathBuf; use std::path::PathBuf;
const SOCKET_PATH: &str = "/var/run/enode/hostagent.sock";
/// # Enum `MetricsPrebootParams` /// # Enum `MetricsPrebootParams`
/// ## for setting up metrics mode as preboot param from command prompt /// ## for setting up metrics mode as preboot param from command prompt
/// ///
@ -186,8 +188,18 @@ pub struct PrebootParams {
impl PrebootParams { impl PrebootParams {
pub fn validate(mut self) -> Result<Self> { pub fn validate(mut self) -> Result<Self> {
if !self.socket_path.exists() && !self.no_hostagent { if !self.socket_path.exists() && !self.no_hostagent {
eprintln!("Error: Socket-file not found or Noxis can't read it. Socket-file was set to default"); if self.socket_path.to_string_lossy() == SOCKET_PATH {
self.socket_path = PathBuf::from("/var/run/enode/hostagent.sock"); self.no_hostagent = true;
eprintln!("Warning: Socket-file wasn't found. Working without hostagent module...");
} else {
eprintln!("Warning: Socket-file wasn't found or Noxis can't read it. Socket-file was set to default");
if !PathBuf::from(SOCKET_PATH).exists() {
self.no_hostagent = true;
eprintln!("Warning: Socket-file wasn't found. Working without hostagent module...");
} else {
self.socket_path = PathBuf::from(SOCKET_PATH);
}
}
// return Err(Error::msg("Socket-file not found or Noxis can't read it. Cannot start")); // return Err(Error::msg("Socket-file not found or Noxis can't read it. Cannot start"));
} }
// existing log dir // existing log dir