Fixed missing /run/shm directory
@@ -8,6 +8,7 @@ use std::ptr::null;
use libc::{c_ulong, c_int};
use libmount::{BindMount, Tmpfs};
+use file_util::Dir;
use path_util::ToCString;
// sys/mount.h
@@ -187,5 +188,9 @@ pub fn mount_run(run_dir: &Path) -> Result<(), String> {
.size_bytes(100 << 20)
.mode(0o755)
.mount().map_err(|e| format!("{}", e))?;
+ // We should create /run/shm directory since
+ // some systems have /dev/shm as a symlink to the /run/shm
+ try_msg!(Dir::new(&run_dir.join("shm")).mode(0o1777).create(),
+ "Error creating /vagga/root/run/shm: {err}");
Ok(())
}
