Skip to content

Commit

Permalink
Create mount-point in logrotate-fs start if it does not exist
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
blt committed Oct 31, 2024
1 parent 4b52809 commit 0dc9edd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lading/src/generator/file_gen/logrotate_fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use serde::{Deserialize, Serialize};
use std::{
collections::HashMap,
ffi::OsStr,
fs,
num::NonZeroU32,
path::PathBuf,
sync::{Arc, Mutex, MutexGuard},
Expand Down Expand Up @@ -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)),
Expand Down

0 comments on commit 0dc9edd

Please sign in to comment.