mirror of
https://github.com/EnumeratedDev/enit.git
synced 2026-09-16 02:26:11 +00:00
Prevent killing process if pid is 0
This commit is contained in:
@@ -353,7 +353,9 @@ func (service *EnitService) StopService() error {
|
|||||||
newServiceStatus := EnitServiceCrashed
|
newServiceStatus := EnitServiceCrashed
|
||||||
defer func() {
|
defer func() {
|
||||||
// Kill remaining child processes
|
// Kill remaining child processes
|
||||||
|
if pid != 0 {
|
||||||
syscall.Kill(-pid, syscall.SIGKILL)
|
syscall.Kill(-pid, syscall.SIGKILL)
|
||||||
|
}
|
||||||
|
|
||||||
service.state = newServiceStatus
|
service.state = newServiceStatus
|
||||||
service.processID = 0
|
service.processID = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user