forked from rosa/hakurei
container/init: ignore finished process
This is not considered an error, if the process finishes while the signal is being delivered. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -495,7 +495,7 @@ func initEntrypoint(k syscallDispatcher, msg message.Msg) {
|
||||
case s := <-sig:
|
||||
if s == CancelSignal && params.ForwardCancel && cmd.Process != nil {
|
||||
msg.Verbose("forwarding context cancellation")
|
||||
if err := k.signal(cmd, os.Interrupt); err != nil {
|
||||
if err := k.signal(cmd, os.Interrupt); err != nil && !errors.Is(err, os.ErrProcessDone) {
|
||||
k.printf(msg, "cannot forward cancellation: %v", err)
|
||||
}
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user