123456789101112131415161718192021222324252627282930 |
- //go:build unix
- package rpcore
- import (
- "context"
- "syscall"
- )
- type UnixSignalShutdownActor struct {
- }
- func (u UnixSignalShutdownActor) Shutdown(info *ShutdownInfo, ctx context.Context) bool {
- if info == nil {
- return false
- }
- if info.Cmd == nil {
- return false
- }
- if info.Cmd.Process == nil {
- return false
- }
- err = info.Cmd.Process.Signal(syscall.SIGINT)
- if err != nil {
- info.LogEmitFunc(fmt.Sprintf("error in sending SIGINT to process (CPID=%16X, PID=%d): %v", info.CPID, info.PID, err))
- return false
- } else {
- return true
- }
- }
|