Open xanatos opened 1 year ago
I've made some tests. The problem seems to be in the nssm . It hangs waiting for the pipes to close. I was able to make a very small program in rust that only logged something and that could reproduce the problem.
use slog::info;
use sloggers::Build;
use sloggers::terminal::{TerminalLoggerBuilder /* , Destination */};
//use sloggers::types::Severity;
fn main() {
let /* mut */ builder = TerminalLoggerBuilder::new();
let logger = builder.build().unwrap();
info!(logger, "Starting!");
let mut line = String::new();
let _b1 = std::io::stdin().read_line(&mut line).unwrap();
info!(logger, "Ending!");
}
Luckily there seems to be a workaround. sloggers logs only on Stderr, and lighthouse, when launched as beaconnode or as a validator, only uses Stderr or logs through sloggers, so no Stdout use. If you don't log Stdout but only log Stderr, then the problem doesn't appear (you can even log Stdout to a different file and everything will work, the problem only appears when you try to log both Stdout AND Stderr to the same file)
Nssm is a quite commonly used (on Windows) tool to make an app a service. The version I'm using (taken from https://nssm.cc/download) is the nssm 2.24-101-g897c7ad (that is the pre-release).
I've done tests on two copies of Windows 11 Pro ITA (various subreleases... I had this problem from the beginning, 6 months ago)
Everything works correctly, unless I try to enable the options Rotate files + Rotate while service is running (
AppRotateFiles 1
andAppRotateOnline 1
)To test, in an administrative console of Windows:
then
The state should be
STOPPED
, but withAppRotateOnline 1
the state isSTOP_PENDING
and the nssm "hangs".Don't know if the bug is in nssm or in how Lighthouse handles the console, and sadly nssm is "abandonware".