Fix esvm exiting on service crash

This commit is contained in:
2025-11-16 17:27:47 +02:00
parent 92587d8099
commit 33e7479044
+3 -2
View File
@@ -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