mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-11-09 05:34:56 -05:00
avoid clock problems on some Docker setups
In particular, this was happening out of the box on Raspberry Pi OS Lite 20210304, as reported by ironoxidizer@gmail.com here: https://groups.google.com/g/moonfire-nvr-users/c/2j9LvfFl2u8/m/tJcNS2WfCQAJ * adjust main.rs to make the problem more obvious * mention it in the troubleshooting guide * sidestep it in the nvr docker wrapper script also just use --networking=host rather than --publish (avoiding a proxy process). I'm using Docker to simplify the build and deployment process, not as a security boundary, so just do the simpler thing.
This commit is contained in:
@@ -137,6 +137,15 @@ fn panic_hook(p: &std::panic::PanicInfo) {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
if let Err(e) = nix::time::clock_gettime(nix::time::ClockId::CLOCK_MONOTONIC) {
|
||||
eprintln!(
|
||||
"clock_gettime failed: {}\n\n\
|
||||
This indicates a broken environment. See the troubleshooting guide.",
|
||||
e
|
||||
);
|
||||
std::process::exit(1);
|
||||
}
|
||||
|
||||
let args = Args::from_args();
|
||||
let mut h = mylog::Builder::new()
|
||||
.set_format(
|
||||
|
||||
Reference in New Issue
Block a user