Skip to content

Commit 37934d1

Browse files
committed
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 <[email protected]>
1 parent 56c204c commit 37934d1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lading/src/generator/file_gen/logrotate_fs.rs

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use serde::{Deserialize, Serialize};
1616
use std::{
1717
collections::HashMap,
1818
ffi::OsStr,
19+
fs,
1920
num::NonZeroU32,
2021
path::PathBuf,
2122
sync::{Arc, Mutex, MutexGuard},
@@ -130,6 +131,7 @@ impl Server {
130131
"Creating logrotate filesystem with mount point {mount}",
131132
mount = config.mount_point.display(),
132133
);
134+
fs::create_dir_all(&config.mount_point)?;
133135
// Initialize the FUSE filesystem
134136
let fs = LogrotateFS {
135137
state: Arc::new(Mutex::new(state)),

0 commit comments

Comments
 (0)