diff --git a/01_phase_rust_src/sv/src/status_obj.rs b/01_phase_rust_src/sv/src/status_obj.rs index a87ff49..14a10ae 100644 --- a/01_phase_rust_src/sv/src/status_obj.rs +++ b/01_phase_rust_src/sv/src/status_obj.rs @@ -42,17 +42,8 @@ impl StatusObj { } - // TODO: check if there is a process reading the pipe. + // TODO: check if there is a process reading the pipes. supervise/control and supervise/ok // piste : https://docs.rs/tokio/latest/tokio/net/unix/pipe/struct.OpenOptions.html - //let mut control_option = fs::File::open("supervise/control"); - //let status_option = fs::OpenOptions::new().read(true).open("supervise/control"); - //match control_option { - // Ok(_file) => {}, - // Err(ee) => { - // println!("fail: {}: runsv not running {}", sv, ee); - // return None; - // }, - //}; let status_option = fs::OpenOptions::new().read(true).open("supervise/status"); let mut status = match status_option { Ok(file) => file, @@ -73,8 +64,6 @@ impl StatusObj { }; if size != 20 { - dbg!(size); - dbg!(contents); println!("warning: {}: bad supervise/status format", sv); return None } @@ -120,7 +109,9 @@ impl StatusObj { log: log_exists, }) } + pub fn get_status_string(&mut self) -> String { + // return the status for this service in particular. let status_sv; let pid_string: String;