mirror of
https://github.com/containers/podman.git
synced 2025-10-20 04:34:01 +08:00
Merge pull request #24257 from ericcurtin/CheckProcessRunning-debug
Make error messages more descriptive
This commit is contained in:
@ -360,9 +360,15 @@ func CheckProcessRunning(processName string, pid int) error {
|
|||||||
return fmt.Errorf("failed to read %s process status: %w", processName, err)
|
return fmt.Errorf("failed to read %s process status: %w", processName, err)
|
||||||
}
|
}
|
||||||
if pid > 0 {
|
if pid > 0 {
|
||||||
// child exited
|
// Child exited, process is no longer running
|
||||||
|
if status.Exited() {
|
||||||
return fmt.Errorf("%s exited unexpectedly with exit code %d", processName, status.ExitStatus())
|
return fmt.Errorf("%s exited unexpectedly with exit code %d", processName, status.ExitStatus())
|
||||||
}
|
}
|
||||||
|
if status.Signaled() {
|
||||||
|
return fmt.Errorf("%s was terminated by signal: %s", processName, status.Signal().String())
|
||||||
|
}
|
||||||
|
return fmt.Errorf("%s exited unexpectedly", processName)
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user