mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Log when external signal is received
PiperOrigin-RevId: 220204591 Change-Id: I21a9c6f5c12a376d18da5d10c1871837c4f49ad2
This commit is contained in:
committed by
Shentubot
parent
95722dc4dd
commit
a467f09261
@@ -445,6 +445,18 @@ const (
|
||||
DeliverToForegroundProcessGroup
|
||||
)
|
||||
|
||||
func (s SignalDeliveryMode) String() string {
|
||||
switch s {
|
||||
case DeliverToProcess:
|
||||
return "Process"
|
||||
case DeliverToAllProcesses:
|
||||
return "All"
|
||||
case DeliverToForegroundProcessGroup:
|
||||
return "Foreground Process Group"
|
||||
}
|
||||
return fmt.Sprintf("unknown signal delivery mode: %d", s)
|
||||
}
|
||||
|
||||
// SignalArgs are arguments to the Signal method.
|
||||
type SignalArgs struct {
|
||||
// CID is the container ID.
|
||||
|
||||
@@ -336,6 +336,7 @@ func New(args Args) (*Loader, error) {
|
||||
// properly.
|
||||
deliveryMode = DeliverToForegroundProcessGroup
|
||||
}
|
||||
log.Infof("Received external signal %d, mode: %v", sig, deliveryMode)
|
||||
if err := l.signal(args.ID, 0, int32(sig), deliveryMode); err != nil {
|
||||
log.Warningf("error sending signal %v to container %q: %v", sig, args.ID, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user