removing dev branch, many changes

This commit is contained in:
John Smith
2023-05-29 19:24:57 +00:00
parent 1430f3f656
commit 0a890c8707
250 changed files with 18084 additions and 8040 deletions
+18 -18
View File
@@ -7,7 +7,7 @@ use clap::ArgMatches;
use futures_util::StreamExt;
use signal_hook::consts::signal::*;
use signal_hook_async_std::Signals;
use std::io::Read;
//use std::io::Read;
use tracing::*;
#[instrument(skip(signals))]
@@ -34,23 +34,23 @@ pub fn run_daemon(settings: Settings, _matches: ArgMatches) -> EyreResult<()> {
let s = settings.read();
if let Some(pid_file) = s.daemon.pid_file.clone() {
daemon = daemon.pid_file(pid_file.clone()); //.chown_pid_file(true);
daemon = daemon.exit_action(move || {
// wait for pid file to exist before exiting parent
let pid_path = std::path::Path::new(&pid_file);
loop {
if let Ok(mut f) = std::fs::File::open(pid_path) {
let mut s = String::new();
if f.read_to_string(&mut s).is_ok()
&& !s.is_empty()
&& s.parse::<u32>().is_ok()
{
println!("pidfile found");
break;
}
}
std::thread::sleep(std::time::Duration::from_millis(100));
}
})
// daemon = daemon.exit_action(move || {
// // wait for pid file to exist before exiting parent
// let pid_path = std::path::Path::new(&pid_file);
// loop {
// if let Ok(mut f) = std::fs::File::open(pid_path) {
// let mut s = String::new();
// if f.read_to_string(&mut s).is_ok()
// && !s.is_empty()
// && s.parse::<u32>().is_ok()
// {
// println!("pidfile found");
// break;
// }
// }
// std::thread::sleep(std::time::Duration::from_millis(100));
// }
// })
}
if let Some(chroot) = &s.daemon.chroot {
daemon = daemon.chroot(chroot);