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,
|
1,
|
||||||
Some(CGroupOption {
|
Some(CGroupOption {
|
||||||
cpu_max: Some(CpuLimit {
|
cpu_max: Some(CpuLimit {
|
||||||
max: CGroupLimitValue::Value(10000),
|
max: CGroupLimitValue::Max,
|
||||||
period: 100000,
|
period: 100000,
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
@ -53,13 +53,6 @@ impl IzoliBox {
|
|||||||
None::<&str>,
|
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 = [
|
let mounts = [
|
||||||
("tmp", "tmpfs", MsFlags::empty()),
|
("tmp", "tmpfs", MsFlags::empty()),
|
||||||
("proc", "proc", MsFlags::empty()),
|
("proc", "proc", MsFlags::empty()),
|
||||||
@ -73,6 +66,7 @@ impl IzoliBox {
|
|||||||
|
|
||||||
for (target, source, flags) in mounts.iter() {
|
for (target, source, flags) in mounts.iter() {
|
||||||
info!("mounting {} {} {:?}", target, source, flags);
|
info!("mounting {} {} {:?}", target, source, flags);
|
||||||
|
fs::create_dir_all(format!("{}/{}", root, target))?;
|
||||||
let full_target = format!("{}/{}", root, target);
|
let full_target = format!("{}/{}", root, target);
|
||||||
Self::umount_mount(
|
Self::umount_mount(
|
||||||
Some(source),
|
Some(source),
|
||||||
|
Reference in New Issue
Block a user