diff --git a/src/main.rs b/src/main.rs index 5f32d71..4d7c39a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,7 +22,6 @@ mod network; static WORKSPACE: &str = "/home/rocker"; static USER_NAME: &str = "rocker"; static INFO_FILE: &str = "info.toml"; -static LOCK_FILE: &str = ".lock"; static mut STACK: [u8; 1024*1024*1] = [0; 1024*1024*1]; static CLONE_FLAG: i32 = 0b1101100000000100000000000000000; // CLONE_NEWNS | CLONE_NEWUTS | CLONE_NEWPID | CLONE_NEWIPC | CLONE_NEWNET; @@ -120,16 +119,6 @@ fn extend_image(image_name: &String) -> Result { } } -fn init_container_lock>(container_work_path:P) -> Result { - use nix::sys::stat::Mode; - use nix::fcntl::{OFlag, open}; - let lock_path = container_work_path.as_ref().join(LOCK_FILE); - let lock_path_str = lock_path.as_os_str(); - let oflag = OFlag::O_RDWR | OFlag::O_CREAT; - let mode = Mode::empty(); - println!("{lock_path_str:?}"); - Ok(open(lock_path_str, oflag, mode)?) -} fn init_container_overlay>(volume_path: P, upper_path: P, merged_path: P) -> Result<()> { let lower_dir = volume_path.as_ref().to_string_lossy().to_string(); @@ -424,7 +413,6 @@ fn run_container(_container_id: &String, cmd: &String, args: &RockerArgs, volume create_dir(&container_merged_path, true)?; let _cb = || { - init_container_lock(&container_work_path).unwrap(); init_container_overlay(volume_path, &container_upper_path, &container_merged_path).unwrap(); if let Some(custom_volume) = &args.volume { init_container_custom_volume(&container_merged_path, custom_volume).unwrap(); @@ -514,7 +502,6 @@ fn save_container_info(args: &RockerArgs, container_id: &String, pid: i32) -> Re fn get_container_info(container_id: &str) -> Result { let container_work_path = Path::new(WORKSPACE).join("containers").join(container_id); let container_info_path = container_work_path.join(INFO_FILE); - let lock_path = container_work_path.join(LOCK_FILE); let info_str = fs::read_to_string(container_info_path)?; let mut container_info: ContainerInfo = toml::from_str(&info_str)?;