diff --git a/sled-agent/src/bootstrap/agent.rs b/sled-agent/src/bootstrap/agent.rs index 3b4b400e34..118a6aa26d 100644 --- a/sled-agent/src/bootstrap/agent.rs +++ b/sled-agent/src/bootstrap/agent.rs @@ -138,6 +138,22 @@ impl Agent { "server" => sled_config.id.to_string(), )); + // We expect this directory to exist - ensure that it does, before any + // subsequent operations which may write configs here. + info!( + log, "Ensuring config directory exists"; + "path" => omicron_common::OMICRON_CONFIG_PATH, + ); + tokio::fs::create_dir_all(omicron_common::OMICRON_CONFIG_PATH) + .await + .map_err(|err| BootstrapError::Io { + message: format!( + "Creating config directory {}", + omicron_common::OMICRON_CONFIG_PATH + ), + err, + })?; + let data_link = if let Some(link) = sled_config.data_link.clone() { link } else { diff --git a/sled-agent/src/rack_setup/service.rs b/sled-agent/src/rack_setup/service.rs index 83140730b4..602c7b7d8e 100644 --- a/sled-agent/src/rack_setup/service.rs +++ b/sled-agent/src/rack_setup/service.rs @@ -416,18 +416,6 @@ impl ServiceInner { ) -> Result<(), SetupServiceError> { info!(self.log, "Injecting RSS configuration: {:#?}", config); - // We expect this directory to exist - ensure that it does, before any - // subsequent operations which may write configs here. - tokio::fs::create_dir_all(omicron_common::OMICRON_CONFIG_PATH) - .await - .map_err(|err| SetupServiceError::Io { - message: format!( - "Creating config directory {}", - omicron_common::OMICRON_CONFIG_PATH - ), - err, - })?; - // Check if a previous RSS plan has completed successfully. // // If it has, the system should be up-and-running.