mirror of
https://github.com/mii443/izoli.git
synced 2025-08-22 16:05:40 +00:00
merge create dir and mount
This commit is contained in:
@ -25,7 +25,7 @@ fn main() {
|
||||
1,
|
||||
Some(CGroupOption {
|
||||
cpu_max: Some(CpuLimit {
|
||||
max: CGroupLimitValue::Value(10000),
|
||||
max: CGroupLimitValue::Max,
|
||||
period: 100000,
|
||||
}),
|
||||
}),
|
||||
|
@ -53,13 +53,6 @@ impl IzoliBox {
|
||||
None::<&str>,
|
||||
)?;
|
||||
|
||||
for dir in &[
|
||||
"/proc", "/dev", "/tmp", "/lib", "/usr", "/bin", "/lib64", "/usr/lib", "/usr/bin",
|
||||
] {
|
||||
info!("creating {}", dir);
|
||||
fs::create_dir_all(format!("{}{}", root, dir))?;
|
||||
}
|
||||
|
||||
let mounts = [
|
||||
("tmp", "tmpfs", MsFlags::empty()),
|
||||
("proc", "proc", MsFlags::empty()),
|
||||
@ -73,6 +66,7 @@ impl IzoliBox {
|
||||
|
||||
for (target, source, flags) in mounts.iter() {
|
||||
info!("mounting {} {} {:?}", target, source, flags);
|
||||
fs::create_dir_all(format!("{}/{}", root, target))?;
|
||||
let full_target = format!("{}/{}", root, target);
|
||||
Self::umount_mount(
|
||||
Some(source),
|
||||
|
Reference in New Issue
Block a user