mirror of
https://github.com/EnumeratedDev/enit.git
synced 2026-09-16 02:26:11 +00:00
Fix esvm exiting on service crash
This commit is contained in:
+3
-2
@@ -246,6 +246,7 @@ func (service *EnitService) StartService() (err error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pid := cmd.Process.Pid
|
||||||
service.processID = cmd.Process.Pid
|
service.processID = cmd.Process.Pid
|
||||||
service.state = EnitServiceStarting
|
service.state = EnitServiceStarting
|
||||||
|
|
||||||
@@ -260,7 +261,7 @@ func (service *EnitService) StartService() (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Kill process and children
|
// Kill process and children
|
||||||
syscall.Kill(-service.processID, syscall.SIGKILL)
|
syscall.Kill(-pid, syscall.SIGKILL)
|
||||||
|
|
||||||
service.processID = 0
|
service.processID = 0
|
||||||
service.state = EnitServiceCrashed
|
service.state = EnitServiceCrashed
|
||||||
@@ -284,7 +285,7 @@ func (service *EnitService) StartService() (err error) {
|
|||||||
service.restartCount = 0
|
service.restartCount = 0
|
||||||
default:
|
default:
|
||||||
// Kill remaining child processes
|
// Kill remaining child processes
|
||||||
syscall.Kill(-service.processID, syscall.SIGKILL)
|
syscall.Kill(-pid, syscall.SIGKILL)
|
||||||
|
|
||||||
if service.Type == "simple" && err == nil {
|
if service.Type == "simple" && err == nil {
|
||||||
service.restartCount = 0
|
service.restartCount = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user