container/init: improve signal handling

The SIGTERM signal is delivered in many other cases and can lead to strange behaviour. The unconditional resume of the logger also causes strange behaviour in the cancellation forwarding path. This change also passes through additional signals.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-10-23 08:02:03 +09:00
parent c5aefe5e9d
commit 57231d4acf
3 changed files with 217 additions and 14 deletions

View File

@@ -24,7 +24,7 @@ import (
const (
// CancelSignal is the signal expected by container init on context cancel.
// A custom [Container.Cancel] function must eventually deliver this signal.
CancelSignal = SIGTERM
CancelSignal = SIGUSR2
)
type (