Daemonize after creating the repository.
This solves
@@ -67,6 +67,10 @@ fn run_forever(config: &Config) -> Result<(), ProcessingError> {
warn!("no-process option ignored in repeat mode");
}
+ let repo = Repository::new(
+ config.cache_dir.clone(), config.tal_dir.clone(), config.strict, true
+ )?;
+
if config.mode.is_daemon() {
if let Err(err) = daemonize::Daemonize::new().start() {
println!("Daemonization failed: {}", err);
@@ -74,10 +78,6 @@ fn run_forever(config: &Config) -> Result<(), ProcessingError> {
}
}
- let repo = Repository::new(
- config.cache_dir.clone(), config.tal_dir.clone(), config.strict, true
- )?;
-
// Start out with validation so that we only fire up our sockets once we
// are actually ready.
if let Err(_) = repo.update() {
