From 33e7479044936cf8c2476be55ce1b785e525b778 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Sun, 16 Nov 2025 17:27:47 +0200 Subject: [PATCH] Fix esvm exiting on service crash --- src/esvm/service.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/esvm/service.go b/src/esvm/service.go index 5afd50d..0ab3da8 100644 --- a/src/esvm/service.go +++ b/src/esvm/service.go @@ -246,6 +246,7 @@ func (service *EnitService) StartService() (err error) { return err } + pid := cmd.Process.Pid service.processID = cmd.Process.Pid service.state = EnitServiceStarting @@ -260,7 +261,7 @@ func (service *EnitService) StartService() (err error) { } // Kill process and children - syscall.Kill(-service.processID, syscall.SIGKILL) + syscall.Kill(-pid, syscall.SIGKILL) service.processID = 0 service.state = EnitServiceCrashed @@ -284,7 +285,7 @@ func (service *EnitService) StartService() (err error) { service.restartCount = 0 default: // Kill remaining child processes - syscall.Kill(-service.processID, syscall.SIGKILL) + syscall.Kill(-pid, syscall.SIGKILL) if service.Type == "simple" && err == nil { service.restartCount = 0