@@ -7,11 +7,11 @@ import (
7
7
"os"
8
8
"path/filepath"
9
9
"strings"
10
- "syscall"
11
10
"time"
12
11
13
12
hostagentevents "github.com/lima-vm/lima/pkg/hostagent/events"
14
13
networks "github.com/lima-vm/lima/pkg/networks/reconcile"
14
+ "github.com/lima-vm/lima/pkg/osutil"
15
15
"github.com/lima-vm/lima/pkg/store"
16
16
"github.com/lima-vm/lima/pkg/store/filenames"
17
17
"github.com/sirupsen/logrus"
@@ -65,7 +65,7 @@ func stopInstanceGracefully(inst *store.Instance) error {
65
65
66
66
begin := time .Now () // used for logrus propagation
67
67
logrus .Infof ("Sending SIGINT to hostagent process %d" , inst .HostAgentPID )
68
- if err := syscall . Kill (inst .HostAgentPID , syscall . SIGINT ); err != nil {
68
+ if err := osutil . SysKill (inst .HostAgentPID , osutil . SigInt ); err != nil {
69
69
logrus .Error (err )
70
70
}
71
71
@@ -106,7 +106,7 @@ func waitForHostAgentTermination(ctx context.Context, inst *store.Instance, begi
106
106
func stopInstanceForcibly (inst * store.Instance ) {
107
107
if inst .QemuPID > 0 {
108
108
logrus .Infof ("Sending SIGKILL to the QEMU process %d" , inst .QemuPID )
109
- if err := syscall . Kill (inst .QemuPID , syscall . SIGKILL ); err != nil {
109
+ if err := osutil . SysKill (inst .QemuPID , osutil . SigKill ); err != nil {
110
110
logrus .Error (err )
111
111
}
112
112
} else {
@@ -115,7 +115,7 @@ func stopInstanceForcibly(inst *store.Instance) {
115
115
116
116
if inst .HostAgentPID > 0 {
117
117
logrus .Infof ("Sending SIGKILL to the host agent process %d" , inst .HostAgentPID )
118
- if err := syscall . Kill (inst .HostAgentPID , syscall . SIGKILL ); err != nil {
118
+ if err := osutil . SysKill (inst .HostAgentPID , osutil . SigKill ); err != nil {
119
119
logrus .Error (err )
120
120
}
121
121
} else {
0 commit comments