From 02d4074dcae092eecf97aefd2495c2c023b870de Mon Sep 17 00:00:00 2001 From: "Brian L. Troutwine" Date: Tue, 29 Oct 2024 16:28:17 -0700 Subject: [PATCH] Create mount-point in logrotate-fs start if it does not exist This commit allows the logrotate_fs to create its mountpoint in the event that the user has not created the directory ahead of time. Signed-off-by: Brian L. Troutwine --- lading/src/generator/file_gen/logrotate_fs.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lading/src/generator/file_gen/logrotate_fs.rs b/lading/src/generator/file_gen/logrotate_fs.rs index 92f62007b..3fad75872 100644 --- a/lading/src/generator/file_gen/logrotate_fs.rs +++ b/lading/src/generator/file_gen/logrotate_fs.rs @@ -16,6 +16,7 @@ use serde::{Deserialize, Serialize}; use std::{ collections::HashMap, ffi::OsStr, + fs, num::NonZeroU32, path::PathBuf, sync::{Arc, Mutex, MutexGuard}, @@ -130,6 +131,7 @@ impl Server { "Creating logrotate filesystem with mount point {mount}", mount = config.mount_point.display(), ); + fs::create_dir_all(&config.mount_point)?; // Initialize the FUSE filesystem let fs = LogrotateFS { state: Arc::new(Mutex::new(state)),