container: fix the issue of send signal to process

It's better to check the container's status before
try to send signal to it. Since there's no need
to send signal to it when the container's stopped.

Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
This commit is contained in:
Fupan Li 2024-07-19 09:45:29 +08:00
parent e156516bde
commit c51ba73199

View File

@ -275,6 +275,10 @@ impl ContainerInner {
signal: u32,
all: bool,
) -> Result<()> {
if self.check_state(vec![ProcessStatus::Stopped]).await.is_ok() {
return Ok(());
}
let mut process_id: agent::ContainerProcessID = process.clone().into();
if all {
// force signal init process