mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-27 15:57:09 +00:00
rpc: fix the issue of kill container process
When kill a process, if the exec id is empty, then it means to kill all processes in the container, if the exec id isn't empty, then it will only kill the specific exec process. Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
This commit is contained in:
parent
6d61ab439c
commit
32431d701c
@ -305,6 +305,7 @@ impl agentService {
|
||||
let eid = req.exec_id.clone();
|
||||
let s = Arc::clone(&self.sandbox);
|
||||
let mut sandbox = s.lock().unwrap();
|
||||
let mut init = false;
|
||||
|
||||
info!(
|
||||
sl!(),
|
||||
@ -312,7 +313,12 @@ impl agentService {
|
||||
"container-id" => cid.clone(),
|
||||
"exec-id" => eid.clone()
|
||||
);
|
||||
let p = find_process(&mut sandbox, cid.as_str(), eid.as_str(), true)?;
|
||||
|
||||
if eid == "" {
|
||||
init = true;
|
||||
}
|
||||
|
||||
let p = find_process(&mut sandbox, cid.as_str(), eid.as_str(), init)?;
|
||||
|
||||
let mut signal = Signal::try_from(req.signal as i32).unwrap();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user